X server with sound inside an OpenVZ / Proxmox container

Mike Green
Aug 24, 2009 · 5 min read
Image for post
Image for post

Preparing the host node

modprobe snd_dummy
lsmod | grep snd
snd_dummy              23168  0
snd_pcm 97288 1 snd_dummy
snd_timer 35464 1 snd_pcm
snd 79784 3 snd_dummy,snd_pcm,snd_timer
soundcore 18208 1 snd
snd_page_alloc 19984 1 snd_pcm
echo "snd_dummy" >> /etc/modules

Preparing the container

Setting device privileges

vzctl set 100 --devices c:116:all:rw --devices c:4:all:rw --save

Cloning the sound devices

ls -la /dev/snd
crw-rw----  1 root audio 116, 6 2009-08-14 20:42 controlC0
crw-rw---- 1 root audio 116, 5 2009-08-14 20:42 pcmC0D0c
crw-rw---- 1 root audio 116, 4 2009-08-14 20:42 pcmC0D0p
crw-rw---- 1 root audio 116, 3 2009-08-14 20:42 seq
crw-rw---- 1 root audio 116, 2 2009-08-14 20:42 timer
vzctl enter 100
rm -r /dev/snd
mkdir /dev/snd
mknod /dev/snd/controlC0 c 116 6
mknod /dev/snd/pcmC0D0c c 116 5
mknod /dev/snd/pcmC0D0p c 116 4
mknod /dev/snd/seq c 116 3
mknod /dev/snd/timer c 116 2
chmod 660 /dev/snd/*
chown :audio /dev/snd/*
adduser skype audio

Installing Xorg Server

Prior to installation

rm /dev/tty0
ln -s /dev/tty1 /dev/tty0
aptitude remove nscd

Download and install packages

aptitude -R install xorg xserver-xorg-video-dummy xserver-xorg-input-kbd xserver-xorg-input-mouse alsa-base linux-sound-base libaudiofile0 dbus udev-

Edit the configuration

Section "InputDevice"
Identifier "Dummy Input"
Driver "void"
Section "Device"
Identifier "Dummy Video"
Driver "dummy"
Section "Monitor"
Identifier "Configured Monitor"
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Dummy Video"
Section "ServerLayout"
Identifier "Default Layout"
Screen "Default Screen"
InputDevice "Dummy Input"
/usr/bin/X :<DISPLAY#>
su skype -c “echo secret:password | DISPLAY=:1 /usr/bin/skype — pipelogin 2>>skype_errors.log &”

Remote access using Nomachine NX

dpkg -i nxclient_3.3.0-6_i386.deb
dpkg -i nxnode_3.3.0-17_i386.deb
dpkg -i nxserver_3.3.0-22_i386.deb
vzctl set 105 — devices c:116:all:rw — devices c:4:all:rw — sav


Myatu’s Tech Blog, from the site that has been wasting bits…

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store