How to create your own OVD subsystem

The default subsystem provided by Ulteo is an Ubuntu Lucid 32-bit. This page explains how to create an OVD subsytem in Debian Squeeze 64-bit.

An OVD subsystem is basically a chroot with some extra packages to provide Ulteo OVD functionalities. Ulteo provides packages for Ubuntu Lucid and Precise, and Debian Squeeze. For Debian Wheezy, some packages are missing (mainly uxda-server) that prevent to install a subsystem based on Debian Wheezy. See http://archive.ulteo.com/ovd/4.0/ for available operating systems packages.

Get a new chroot

If you just need an OVD subsystem based on Debian Squeeze 64-bit or Ubuntu Precise 64-bit, download it:

Debian Squeeze 64-bit

Ubuntu Precise 64-bit

Then install it.

Create a new chroot

The following instructions have been used to create a Debian Squeeze 64-bit subsystem on a Debian Wheezy 64-bit host.

Warning: some server optimized kernels forbid (like the one at OVH) to set the sticky bit within a chroot environment. This results in a total mess when installing packages. That's why I had to create this chroot on a regular desktop kernel.

Name the directory where will be installed the chroot:

MY_CHROOT=/opt/ulteo_squeeze

Install debootstrap:

apt-get install debootstrap

Create the base system:

debootstrap squeeze $MY_CHROOT

Allow the chroot to work in your host environment:

mount --bind /dev $MY_CHROOT/dev
mount --bind /dev/shm $MY_CHROOT/dev/shm
mount --bind /dev/pts $MY_CHROOT/dev/pts
mount --bind /sys $MY_CHROOT/sys
mount -t proc /proc $MY_CHROOT/proc
cp /etc/hosts $MY_CHROOT/etc/hosts
cp /proc/mounts $MY_CHROOT/etc/mtab
cp /etc/resolv.conf $MY_CHROOT/etc/resolv.conf

Enter into the chroot:

cd $MY_CHROOT
chroot $MY_CHROOT

Warning: all commands must now be entered in the chroot. Be careful to enter the commands in the chroot and not in your host system.

Install some basic packages:

apt-get update
apt-get install vim
apt-get install locales
dpkg-reconfigure locales
dpkg-reconfigure tzdata

Add the Debian main repository and the Ulteo OVD repository in /etc/apt/sources.list:

deb http://ftp.fr.debian.org/debian squeeze main
deb http://security.debian.org/ squeeze/updates main contrib non-free
deb http://http.debian.net/debian squeeze-lts main contrib non-free
deb http://archive.ulteo.com/ovd/4.0.2/debian squeeze main

Remark: for Ubuntu Precise, your sources.list should be:

deb http://archive.ubuntu.com/ubuntu precise main restricted universe multiverse
deb http://archive.ulteo.com/ovd/4.0.2/ubuntu precise main

Then update the packages list:

apt-get update
apt-get install ulteo-keyring
apt-get update

Only needed for Lucid (not Precise): In the chroot, remove /dev/shm because there is a recursive link with /run/shm:

rm -rf /dev/shm
mkdir /dev/shm
chmod 1777 /dev/shm

Install the packages to create an OVD subsystem:

apt-get install ulteo-ovd-desktop ulteo-ovd-slaveserver ulteo-ovd-slaveserver-role-aps ulteo-ovd-slaveserver-role-fs uxda-server ulteo-ovd-externalapps-client ulteo-ovd-integrated-launcher ulteo-xfce4-restricted-menu-plugin libovd-xclient-area apache2 samba

Remove the apache port config:

mv /etc/apache2/ports.conf /etc/apache2/ports.conf.orig
touch /etc/apache2/ports.conf

Only needed for Lucid (not Precise): Create a link from smbd to samba, so that it can be started by /etc/init.d/ulteo-ovd-subsystem:

cd /etc/init.d
ln -s samba smbd

Check if /dev/fuse exists:

ls -l /dev/fuse

if not, create it:

mknod /dev/fuse c 10 229

Check its rights:

ls -l /dev/fuse

must return:

crw-rw---T 1 root fuse 10, 229

If not fix it:

chmod 1660 /dev/fuse
chown root.fuse /dev/fuse

In /etc/issue and /etc/issue.net, put:

Ulteo OVD 4.0.2

Remark: It is needed if you had previously added the default subsystem on the same session manager.

Leave the chroot (ctrl+d).

Unmoot the chroot mount points:

umount $MY_CHROOT/dev/pts
umount $MY_CHROOT/dev/shm
umount $MY_CHROOT/sys
umount $MY_CHROOT/proc
umount $MY_CHROOT/dev

Create the archive:

cd $MY_CHROOT
tar czf ../base.tar.gz *

And voila!

Install your new chroot

Copy base.tar.gz on your server to /var/cache/ulteo/sessionmanager/.

Note: The following instructions don't work if you have already installed an OVD subsystem.

Warning: backup your database before continuing!

In OVD administration panel, put the server in maintenance mode. Then:

/etc/init.d/ulteo-ovd-subsystem stop
mv /opt/ulteo /opt/ulteo.orig
mkdir /opt/ulteo
cd /opt/ulteo
tar xzf /var/cache/ulteo/sessionmanager/base.tar.gz
/etc/init.d/ulteo-ovd-subsystem start

Go back in OVD administration panel to put the server in production.

You must install this new chroot in a blank new application server. Just after having copying the base.tar.gz in /var/cache/ulteo/sessionmanager/, install ulteo-ovd-subsystem:

apt-get install ulteo-ovd-subsytem

Then, go in the administration panel Unregistered servers to register it and put it in production.