Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

X inside VE

1,825 bytes added, 09:03, 13 April 2016
Using Xephyr: changed comma to dot in DISPLAY value
There are several ways to run X applications inside your [[container]].
comment5== X forwarding == === Single application === To run an X application inside a [[container]],one needs simply to connect to a container with '''ssh -X''':<pre>host# ssh -2 -c blowfish -X user@address</pre> After login to container check that <code>$DISPLAY</code> variable is set and X11 forwarding is enabled:<pre>ve# echo $DISPLAYlocalhost:10.0</pre> In case <code>$DISPLAY</code> is not set, make sure that X forwarding is enabled in <code>sshd</code> config inside container. In most Linux distros sshd configuration is stored in <code>/etc/ssh/sshd_config</code>. You should set parameter <code>X11Forwarding</code> to <code>yes</code>. Also container should contain <code>xauth</code> package, thus install <code>xauth</code> if it is missing (in Debian this is part of the xbase-clients package). After that, restart your sshd daemon:<pre>ve# /etc/init.d/sshd restart</pre> {{Note|Don't forget to reconnect after this}} Now you can run X applications from your container:<pre>ve# firefox</pre> === Desktop === Note : If you want to run complete X window environment (including window manager), you should kill local window manager and run only pure X server. Secondly you should use '''-Y''' option when invoking ssh. And if you want to run gnome/kde/..., don't forget to increase [[UBC]] limits, 'cause default values are certainly too small for these monsters. ;) You can run a desktop with ''xinit'' (on the node): <pre>xinit -e ssh -XCc blowfish user@ip_address "/usr/bin/xfce4-session &" -- :1 & disown</pre> * Substitute the window manager of choice* Once xfce has started, you can then close the xterm if you like  Your node will be on Ctrl-Alt-F7 And your VM on Ctrl-Alt-F8
== VNC for X desktop ==
Change your display settings (don't forget to change them back after you establish a connection)
<pre>DISPLAY=:1,.0</pre>
Forward your application or desktop over ssh to Xephyr
===== GDM =====
Edit the '''gdm.conf''' file and in xdmcp section, comment out the '''0=standard ''' line under the [servers] section - this will prevent gdm from trying to launch an X server on the local machine - it will simply listen for xdmcp requests. Insert '''0=inactive''' in [servers] section. Insert '''Enable=1''' in [xdmcp] section. Also, change from VCAllocation=true to VTAllocation=false and comment out the FirstVT=7 lineif that lines exists. Change the access restrictions (if any) to suit your needs and then start GDM.
=== Client/Host Configuration ===
Anonymous user