User:Rage/Drafts/LXC configuration
From Gentoo Wiki
Jump to:navigation
Jump to:search
# 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
# 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.