Forum: 
Tags: 

[SOLVED] pts and proc errors running LXC appliance in virtual machine

Daryl's picture

Hello,

I've been trying to get the LXC appliance running in a virtual machine, and I'm getting errors when I run the lxc-create script in either KVM or VirtualBox (lxc-create -n wp -t turnkey -- wordpress -i /tmp/inithooks.conf -v 14.1-jessie).  I am getting some errors related to /dev/pts and /proc at the end of the creation script console output and the container won't let me attach to it

Does anyone have advice for troubleshooting?

Thanks,
Daryl

 

...

Fetched 12.1 MB in 11s (1090 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
dpkg is already the newest version.
debian-archive-keyring is already the newest version.
The following packages were automatically installed and are no longer required:
 acl libcryptsetup4 libopts25 libuuid-perl linux-base
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
The following packages will be REMOVED:
 acl libcryptsetup4 libopts25 libuuid-perl linux-base
0 upgraded, 0 newly installed, 5 to remove and 22 not upgraded.
After this operation, 911 kB disk space will be freed.
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)
(Reading database ... 24844 files and directories currently installed.)
Removing acl (2.2.52-2) ...
Removing libcryptsetup4:amd64 (2:1.6.6-5) ...
Removing libopts25:amd64 (1:5.18.4-3) ...
Removing linux-base (3.5) ...
Removing libuuid-perl (0.05-1+b1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for libc-bin (2.19-18+deb8u4) ...
Error, do this: mount -t proc proc /proc

Jeremy Davis's picture

TBH I haven't played with the LXC appliance much but I'm on the forums a fair bit and haven't heard of this issue before. Have your double checked the integrity of your downloaded LXC image? I.e. check the SHA checksum against what is recorded in the sig file? I have experienced weirdness from marginally corrupted images before.

Otherwise I'm not sure and will have to have a play myself and see if I can reproduce it.

Daryl's picture

I just verified that the signature was okay


Jeremy Davis's picture

And whilst I got the same error message as you it all appears to work ok. The container starts fine with "lxc-start -n wp -d". I can enter the container fine with "lxc-console -n wp" and /dev/pts is definitely mounted inside the container:
mount | grep /dev/pts

devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=666)
It seems that the only way to exit the container though is to power it off (or make a new connection to the LXC host). Once I did that I set up the nginx proxy for www.example.net & port forwarded port 2222 for SSHing directly into the WP container:
nginx-proxy --domain www.example.net --name wp
ipaddr=$(host wp | cut -d " " -f 4)
iptables-nat add 2222 $ipaddr:22
After adjusting my local hosts file (to point www.example.net to my LXC host's IP), I can browse to www.example.net and see WordPress. I can also ssh in like this:
ssh -p 2222 root@www.example.net
And everything appears to be working fine...
Daryl's picture

It appears to be working okay now.  It looks like not being able to connect via lxc-attach "sudo lxc-attach -n wp" may have been related to startup time and not the errors on the console.  If I ignore the errors and give the machine some time to start up, the lxc-attach command works okay.

Thanks for your help.


Post new comment