For linuxulator jails? Or just regular jails?
The way to get X11 apps working inside of a jail looks like this:
1. Obviously you need X11 installed to host.
2. Install X11 in your jail, along with any video card drivers (like nvidia-driver)
3. You need the following line in the jail's fstab
Code:
# Device #Mountpoint FStype Options Dump Pass#
/tmp/.X11-unix /jails/yourguijail/tmp/.X11-unix nullfs rw 0 0
-- or you can just hand mount it
mount_nullfs /tmp/.X11-unix /jails/yourguijail/tmp/.X11-unix
4.
xhost + local:
(on host)
5. /etc/devfs.rules needs to unhide a few devices under a custom ruleset. I'm including the sound devices as well here:
Code:
add path 'mixer*' unhide
add path 'dsp*' unhide
add path 'video*' unhide
# If you have an nvidia card, just this line below and you're done
add path 'nvidia*' unhide
# If you have AMD, you'll need these as well
add path dri unhide
add path 'dri/*' unhide
add path drm unhide
add path 'drm/*' unhide
add path pci unhide
# At least I think that's what I needed when I played with an AMD GPU.
# Maybe that last line about PCI is unnecessary, you'll have to confirm with someone else
-- Make sure to add that ruleset for your jail in /etc/jail.conf
service devfs restart
6. Inside the jail you need to export
setenv display :0
To make it persistent, put it inside jail's .cshrc or .shrc
That should be it. Hopefully I haven't missed anything.
I'm really close to being finished with a whole package solution for managing jails in a way that's quite secure, quite convenient, and of course X11 working. It's basically just a set of scripts that act as a wrapper for jail management, kind of like the other options out there.
It's all actually working great for me for like a year now, I just haven't gotten around to cleaning it up; and then packaging it with a nice installer script. I'm hoping in the next few days to be finished with it, and I'll drop it onto github.