User:Rage/Drafts/LXC configuration

From Gentoo Wiki
Jump to:navigation Jump to:search
This article is a work in progress; treat its contents with caution - Rage (talk | contribs).
This article is a stub. Please help out by expanding it - how to get started.
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