User:Rage/Drafts/LXC configuration

From Gentoo Wiki
Jump to: navigation, search
Warning
This page is a work in progress by Rage (talk | contribs). Treat its contents with caution.
This article is a stub. You can help by expanding it.
FILE /etc/lxc/default.conf
# launch xorg applications on host from container
lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry = /dev/snd dev/snd none bind,optional,create=dir
lxc.mount.entry = /tmp/.X11-unix tmp/.X11-unix none bind,optional,create=dir,ro

# use lvm for storage
lxc.rootfs.backend = lvm
root #lxc-attach --clear-env -n $CONTAINER -- surf

Troubleshooting

Home directory permissions

This happens often when using pre-build alpine linux containers.

root #su - user
Unable to cd to "/home/user"

Ensure the root directory has the proper permissions,

root #chmod 755 /

Xorg in container

FILE /var/lib/lxc/alpine/config
# launch xorg applications on host from container
lxc.mount.entry = /dev/dri dev/dri none bind,optional,create=dir
lxc.mount.entry = /dev/snd dev/snd none bind,optional,create=dir
lxc.mount.entry = /tmp/.X11-unix tmp/.X11-unix none bind,ro
user $echo $DISPLAY
:0

After starting the container, ensure that /tmp/.X11-unix/X0 can be found inside the container.

See also

External resources