[lxc-users] LXD Based Container For Desktop Applications - Some Success - Help

brian mullan bmullan.mail at gmail.com
Thu Jul 21 19:53:53 UTC 2016


If you want to run single apps from the container like with microsofts
remoteapp then a really simple way to accomplish it is with x2go & the x2go
published applications

I just configured a new LXD container.   Its simple to setup/configure and
sound, printing, shared folders all work

*Step #1*

Create a privileged container & configure it to autostart:

# Launch an Ubuntu xenial 16.04 64 bit containers and name it cn1.  We are
launching CN1 as a
# PRIVILEGED container:

lxc launch images:ubuntu/xenial/amd64 cn1 -c security.privileged=true

# set LXC container CN1 to autostart when the Host is rebooted

lxc config set cn1 boot.autostart 1

*Step #2*

$ lxc exec cn1 bash

# you will be logged into the CN1 container as root so just execute the
following to install
# Ubuntu-Mate Desktop

Note: you can put all of the following in a bash script..

# Install a desktop in it (I use Ubuntu-Mate:

echo "deb http://archive.canonical.com/ubuntu xenial partner" | tee -a
echo "deb-src http://archive.canonical.com/ubuntu xenial partner" | tee -a
echo "deb http://us.archive.ubuntu.com/ubuntu/ xenial-backports main
restricted universe multiverse" | tee -a /etc/apt/sources.list
echo "deb-src http://us.archive.ubuntu.com/ubuntu/ xenial-backports main
restricted universe multiverse" | tee -a /etc/apt/sources.list

# update & upgrade container
apt-get update
apt-get upgrade -y

# install apt
apt-get install apt -y

# From here on we can use apt to update Everything
apt dist-upgrade -y

#Install miscellaneous

apt install pulseaudio pulseaudio-utils alsa-base alsa-utils
linux-sound-base gstreamer1.0-pulseaudio gstreamer1.0-alsa libpulse-dev -y

# Install UBUNTU-MATE desktop environment as default for all users
including ones added in the # future

add-apt-repository ppa:ubuntu-mate-dev/xenial-mate -y
add-apt-repository ppa:x2go/stable

apt update

apt install lightdm ubuntu-mate-core ubuntu-mate-desktop ufw
ubuntu-restricted-extras ubuntu-restricted-addons -y

echo "Desktop Install Done"

# Configure the Xsession file default desktop environment change ALL future
User additions to default xsession to be UBUNTU-MATE

update-alternatives --set x-session-manager /usr/bin/mate-session

# and some gui based useful tools that aren't included in the

apt install gdebi synaptic gedit wget git terminator network-manager -y

apt install x2goserver x2goserver-xsession

adduser yourID and password in the container and any others you want to add
as users.

# reboot

*Step #3*

On the host all you have to do is install the x2go client

add-apt-repository ppa:x2go/stable

apt update

apt install x2goclient

*Step #4*

launch the x2goclient & follow the directions on the x2go published
applications page (use the IP of your container)

In the x2goclient when you create the Published Application "profile" click
on the connection tab and slide it all the way to the right so x2go doesn't
waste cpu doing any compression.

Save that new Published Application Profile and it will move to the right
side of the x2goclient menu.

Click on it & answer yes to the ssh question on adding the new server.

Look on your top menu bar and you will notice 2 new icons shown,  Click on
the one that has the little Seal icon on it (thats HOCA they mascot for
x2go) and you will see
a pull down menu item called Published Applicaitons.

Click on any one of those and they will startup in the container but be
displayed on your Host Desktop,

x2go has clients for Linux, Mac and Windows as well as a python client.
All are open source.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20160721/a8fcd19a/attachment.html>

More information about the lxc-users mailing list