Open main menu

OpenVZ Virtuozzo Containers Wiki β

Changes

X inside VE

1,709 bytes added, 03:45, 25 October 2010
m
Reverted edits by 79.142.67.109 (Talk) to last revision by 122.116.121.30
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 need 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 ==