LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud
User Name
Password
Linux - Virtualization and Cloud This forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.

Notices


Reply
  Search this Thread
Old 01-31-2013, 09:02 PM   #1
charlie101
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Rep: Reputation: Disabled
Outputting X display from inside an LXC Container


Hi

I'm trying to run lubuntu 12.04 from a LXC container hosted on Ubuntu 12.04.
I would like the lubuntu desktop to appear on my hosts VT9 display.
I've already done this for a text console on VT8 but would like to redirect the X output as well.

I'm suspecious it might be as simple as telling X to output to VT8 rather than VT7 which is occupied by the host. But I don't know where to find this setting in lubuntu 12.04?

I'm also concerned that running two Xservers might be a problem?

I've lost count of the number of articles I've read which mention this issue but skirt around it without answering it.

So any help would be greatly appreciated.

(Update) I tried using text console on this guest and they don't work either. It seems a more general issue then just X.
Guest is Ubuntu 12.04 same has Host.
Guest was created with the Ubuntu template.

Charlie101.

Last edited by charlie101; 02-02-2013 at 05:19 PM. Reason: update information
 
Old 02-04-2013, 09:41 PM   #2
charlie101
LQ Newbie
 
Registered: Jun 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Update

Ok, so I managed to configure an Lubuntu 10.04 container's X display to pop up on a virtual terminal (F8) when the container is started. I never achieved it with 12.04. But in either case it seems to be necessary to grant all sorts of hardware access permissions to the container. Not a good idea as far as security and stability are concerned.

A better approach is to use the XDMCP protocol to remotely connect.
Once you've started the container you can simply issue the command:

Xorg -terminate -query (Container IP_ADDRESS/HOST_Name) :1

eg: Xorg -terminate -query 192.168.1.12 :1

Increment the :1 for each addition container you want to connect to a vt :2 :3 etc.
These will generally pop up as VT8, VT9, VT10 etc although they can also be assigned lower down the line as VT5 VT6 etc where they follow on from your containers reserved VT range set in the container's config file: lxc.tty = 4.

Alternatively you can edit the lightdm.conf files.

In the containers lightdm.conf file you need to add the lines:

[XDMCPServer]
enabled=true


In your hosts lightdm.conf file you need to add the lines:

[LightDM]

minimum-vt=7 #To control where the VTs start poping up on you F keys


[Seat:0] #Controls your host's X output
greeter-session=lightdm-gtk-greeter
user-session=Lubuntu
greeter-hide-users=true

[Seat:1] #Controls your first container's X output
xdmcp-manager=192.168.1.12
greeter-session=lightdm-gtk-greeter
user-session=Lubuntu

[Seat:2] #Controls your 2nd container's X output
xdmcp-manager=192.168.1.13
greeter-session=lightdm-gtk-greeter
user-session=Lubuntu

etc etc

Of course these connections could be between different physical machines across networks rather than containers on the same machine. Be aware that XDMCP is an un-encrypted protocol so has associated security risks.

Charlie101
 
  


Reply

Tags
lxc, virtualization


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
script to get a lxc-container like iso of current. cod_liver_0il Slackware 1 09-10-2012 11:12 AM
Slackware network scripts inside OpenVZ container yenn Slackware 2 08-21-2012 04:19 PM
How to end a Linux Container (LXC) from within? Skaperen Linux - Virtualization and Cloud 0 06-14-2011 09:37 AM
QEMU / DosEMU inside OpenVZ container kirtimaan_bkn Linux - Virtualization and Cloud 2 11-09-2010 09:59 PM
Any way to redirect DISPLAY inside Java app? paulsm4 Programming 0 03-23-2005 07:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Virtualization and Cloud

All times are GMT -5. The time now is 07:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration