Open main menu

OpenVZ Virtuozzo Containers Wiki β

Editing X inside VE

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
There are several ways to run X applications inside your [[container]].
 
There are several ways to run X applications inside your [[container]].
  
== X forwarding ==
+
comment5,
 
 
=== 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 $DISPLAY
 
localhost: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 ==
 
== VNC for X desktop ==
Line 100: Line 57:
 
Change your display settings (don't forget to change them back after you establish a connection)
 
Change your display settings (don't forget to change them back after you establish a connection)
  
<pre>DISPLAY=:1.0</pre>
+
<pre>DISPLAY=:1,0</pre>
  
 
Forward your application or desktop over ssh to Xephyr
 
Forward your application or desktop over ssh to Xephyr
Line 140: Line 97:
  
 
===== GDM =====
 
===== 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 line if that lines exists. Change the access restrictions (if any) to suit your needs and then start 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. Also, change from VCAllocation=true to VTAllocation=false and comment out the FirstVT=7 line. Change the access restrictions (if any) to suit your needs and then start GDM.
  
 
=== Client/Host Configuration ===
 
=== Client/Host Configuration ===

Please note that all contributions to OpenVZ Virtuozzo Containers Wiki may be edited, altered, or removed by other contributors. If you don't want your writing to be edited mercilessly, then don't submit it here.
If you are going to add external links to an article, read the External links policy first!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Template used on this page: