Hello.
I'm trying to start LXC Debian hacking sessions on our V2 LAVA server.
This is the related configuration:
http://pastebin.com/index/DNGpJfc6
And I'm mostly doing what's in here:
https://git.linaro.org/lava-team/hacking-session.git
The problem I'm facing is that inside a script the environment seems to be broken, so there is no way to copy to ~/.ssh.
Regarding the environment I get this output:
$ echo $HOME
$ echo $USER
$ cat /etc/passwd | grep root root:x:0:0:root:/root:/bin/bash $ ls -al /root total 16 drwx------ 2 root root 4096 Dec 16 15:33 . drwxrwxrwx 19 root root 4096 Dec 23 13:18 .. -rw-r--r-- 1 root root 570 Jan 31 2010 .bashrc -rw-r--r-- 1 root root 148 Aug 17 2015 .profile $ env TESTRUN_ID=1_hacksession-debian SHLVL=4 OLDPWD=/ container=lxc _=defs/hacksession-debian/setup_session COLUMNS=80 PATH=/lava-248/1/../bin:/usr/local/bin:/usr/local/sbin:/bin:/usr/bin:/usr/sbin:/sbin LAVA_RESULT_DIR=/lava-248/1/results/1_hacksession-debian-1482499502 LANG=C LC_ALL=C.UTF-8 PWD=/lava-248/1/tests/1_hacksession-debian LINES=24
If I mimic the lava LXC machine creation commands (lxc-create) and I attach to the machine I get a sane environment.
Is this expected behavior?
BR, Rafael Gago
On 23 December 2016 at 13:30, Rafael Gago Castano RGC@hms.se wrote:
Hello.
I'm trying to start LXC Debian hacking sessions on our V2 LAVA server.
This is the related configuration:
That hack to get DHCP working is probably a sign that you need to setup bridging so that the LXC can sort out the networking for you. Look at: https://wiki.debian.org/LXC/SimpleBridge
And I'm mostly doing what's in here:
https://git.linaro.org/lava-team/hacking-session.git
The problem I'm facing is that inside a script the environment seems to be broken, so there is no way to copy to ~/.ssh.
The container is a bare debootstrap, no users are created.
If I mimic the lava LXC machine creation commands (lxc-create) and I attach to the machine I get a sane environment. Is this expected behavior?
A hacking session inside an LXC is of very limited use - a full VM using QEMU is generally a much better idea - that will also need network bridging support using the tap netdevice to allow users to login to the session.
If I mimic the lava LXC machine creation commands (lxc-create) and I
attach to the machine I get a sane environment.
Is this expected behavior?
A hacking session inside an LXC is of very limited use - a full VM using QEMU is generally a much better idea - that will also need network bridging support using the tap netdevice to allow users to login to the session.
The environment that you get in the LXC session is inherited from the environment of the lava-dispatch command. This environment is (by design and for good reasons that I can explain later on) very limited and controlled by the file /etc/lava-server/env.yaml
This is only a guess as I haven't tried on my setup. You can check that this guess is true (or not) by changing /etc/lava-server/env.yaml (setting purge to false). But keep in mind that this is only for testing and not for production!
Cheers
lava-users@lists.lavasoftware.org