Hey folks,
So i try to write a tutorial as good as I can do now.
We start with a Use Case
The Use Case: Did not want to loose the grapics power of my i5 3xxx (Ivy Bridge)
an could not use a Virtual Graphics Card, neither did vifo + iommu work in a VM. ( I tried very very hard)
I WANTED TO HAVE AT LEAST ONE VM WHICH WAS NOT KILLING MY PROCESSOR WHEN I OPEN A Openbox WIndow
Research:
So long story short: i found an entry article about someone wo solved it quiet nice
link: Cool HowTo by Konpat Preechakul
Anyways because of the "xrdp-pulseaudio-installer", which is availabe as a package at Ubuntu 18.04, i kept it this way (in short: you have sound via RDP Session to linux client) . Until I found out Ubuntu 18 is only capable of h.264 with this setup.
On the other way there was a new cool xrdp v 1.2 script by c-nergy.be - which made it possible to compile the xrdp-pulseaudio-installer within Ubuntu 20.04
So as you get bored of stories here finally all the steps I made, to have a "LXC based Xubuntu 20.04 Desktop Enviroment Container with SNAP and VAPI (Intel i915)"
(Which was big pain in my a55. )
1. Make a new privileged (means not unpriviliged) CT in your Proxmox with an Ubuntu 20.04 template and do NOT boot it up immediatly
2. login to your PVE 6.x either local via Webinterface (Shell) or via ssh
apt install nano
#<ID> is the Number of your PV Container e.g. 101
#nano /etc/pve/lxc/<ID>.conf
nano /etc/pve/lxc/101.conf
#It should look like this
3. login in locally via proxomox and do he usual update procedure, an installation of tasksel and the xubuntu-desktop enviroment (exact this way, I had problems when i mixed things up here)
4. Add Sudo User (because no ssh to root in ubuntu by default)
5. Download c-nergy script v 1.2, install unzip, unzip the script, give it exexution rights, execute it
Afterwards you have to go to
Autostart (in AFCE)
Add Programm -> Terminal Options -> Run in Temrinal -> /usr/bin/pulseaudio -k
-> "pulseaudio -k" loads the modul after the Desktop is available
6. Start the CT 101 / Container again via Proxmox.
-> If everything is set up right you should see a Picture via HDMI or Displayport of your Proxmox 6.x Hypervisor - the xfce4 login screen to be exact
-> lmod | grep i915 should generate output on your continer
7. Congrats, half way thru
8. install stuff you willl need later on your continer
9. Set your Applications for your Applications Menu right (Nearly no App was working properly, when I install Xubuntu and logged in via XRDP - Setting were nearly not possible)
10. Make Application entries work - This is a fix for a non fully functional working XRDP Enviroment under XFCE
cd /home/morpheus/.local/share/applications/
sed -i.bak '10d;11d;12d' *.desktop
TIP: In case you still have problems, and need to do settings
-> open console and type "xfce4-settings-manager"
11. Set polkit right so you can reboot and shutdown in xour RDP Session
Link: HowTo set polkit right for XRDP Shutdown and Reboot CLICK ME
and a bit beow
12. Solve SNAP Problems in LXC with Proxmox -
I dunno if I really needed that, but iI installed it
see step 2.
13. check vapi support
14. (sorry i forgot)
^^ if it shows that, Xorg is runing on intel
TIP: In case you wann run GTK (GUI) programs as sudo/root
NOW connect with any RDP Client to your VM and enjoy the GPU working with your Desktop Enviroment and you can use your CPU power for more useful stuff.
I hope the tuorial is exact and you can have some fun - BTW you can use your hypervisor now to watch movies on your TV for example if you install x11vnc
(UPDATE 25.09.2020)
Tests:
1920 x 1080@25Hz Youtube Video with 0 Drops out of 1000 with 30% utilization @ 2 x 2,1 GHz cores
2560 x 1440@25Hz Youtube Video with 1 Drop out of 1000 with 67% utilization @ 2 x 2,1 GHz cores
3840 x 2160@25Hz Youtube Video with 30 Drops out of 1000 with 100% utilization @ 2 x 2,1 GHz cores (i could give th LXC Container mores cores now, but I do not really ned 4k right now)
+ XRDP is using some CPU for the transfer - i would be still lag free on the HDMI Output of the server.
Cheers PSteinberg
So i try to write a tutorial as good as I can do now.
We start with a Use Case
The Use Case: Did not want to loose the grapics power of my i5 3xxx (Ivy Bridge)
an could not use a Virtual Graphics Card, neither did vifo + iommu work in a VM. ( I tried very very hard)
I WANTED TO HAVE AT LEAST ONE VM WHICH WAS NOT KILLING MY PROCESSOR WHEN I OPEN A Openbox WIndow
Research:
So long story short: i found an entry article about someone wo solved it quiet nice
link: Cool HowTo by Konpat Preechakul
Anyways because of the "xrdp-pulseaudio-installer", which is availabe as a package at Ubuntu 18.04, i kept it this way (in short: you have sound via RDP Session to linux client) . Until I found out Ubuntu 18 is only capable of h.264 with this setup.
On the other way there was a new cool xrdp v 1.2 script by c-nergy.be - which made it possible to compile the xrdp-pulseaudio-installer within Ubuntu 20.04
So as you get bored of stories here finally all the steps I made, to have a "LXC based Xubuntu 20.04 Desktop Enviroment Container with SNAP and VAPI (Intel i915)"
(Which was big pain in my a55. )
1. Make a new privileged (means not unpriviliged) CT in your Proxmox with an Ubuntu 20.04 template and do NOT boot it up immediatly
2. login to your PVE 6.x either local via Webinterface (Shell) or via ssh
apt install nano
#<ID> is the Number of your PV Container e.g. 101
#nano /etc/pve/lxc/<ID>.conf
nano /etc/pve/lxc/101.conf
Code:
arch: amd64
cores: 2
features: mount=fuse,fuse=1,nesting=1
hostname: morpheus-desktop
memory: 1536
net0: name=eth0,bridge=vmbr0,hwaddr=AB:CD:EF:12:34:00,ip=dhcp,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-101-disk-0,size=8G
swap: 512
lxc.apparmor.raw: mount,
lxc.mount.entry: /dev/fuse dev/fuse none bind,create=file 0 0
lxc.cap.drop:
lxc.cap.drop: mac_override sys_time sys_module sys_rawio
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: c 226:0 rwm
lxc.cgroup.devices.allow: c 226:128 rwm
lxc.cgroup.devices.allow: c 4:7 rwm
lxc.cgroup.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
lxc.mount.entry: /dev/tty7 dev/tty7 none bind,optional,create=file
lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file
#It should look like this
3. login in locally via proxomox and do he usual update procedure, an installation of tasksel and the xubuntu-desktop enviroment (exact this way, I had problems when i mixed things up here)
Code:
apt update
apt upgrade -y
apt install i965-va-driver
apt install tasksel
taksel install xubuntu-desktop
4. Add Sudo User (because no ssh to root in ubuntu by default)
Code:
adduser morpheus
usermod -aG sudo morpheus
su morpheus
5. Download c-nergy script v 1.2, install unzip, unzip the script, give it exexution rights, execute it
Code:
wget http://c-nergy.be/downloads/xRDP/xrdp-installer-1.2.zip
sudo apt instal unzip xrdp-installer-1.2.zip
sudo chmod +x xrdp-installer-1.2.sh
./xrdp-installer-1.2.sh -s
# the -s is for the sound option aka the xrdp-pulse-audio blah
sudo shutdown -f now
Autostart (in AFCE)
Add Programm -> Terminal Options -> Run in Temrinal -> /usr/bin/pulseaudio -k
-> "pulseaudio -k" loads the modul after the Desktop is available
6. Start the CT 101 / Container again via Proxmox.
-> If everything is set up right you should see a Picture via HDMI or Displayport of your Proxmox 6.x Hypervisor - the xfce4 login screen to be exact
-> lmod | grep i915 should generate output on your continer
7. Congrats, half way thru
8. install stuff you willl need later on your continer
Code:
sudo apt install xfc4 xfce4-goodies
9. Set your Applications for your Applications Menu right (Nearly no App was working properly, when I install Xubuntu and logged in via XRDP - Setting were nearly not possible)
Code:
#cp /usr/share/applications/*.desktop /home/<USERNAME>/.local/share/applications/
cp /usr/share/applications/*.desktop /home/morpheus/.local/share/applications/
10. Make Application entries work - This is a fix for a non fully functional working XRDP Enviroment under XFCE
cd /home/morpheus/.local/share/applications/
sed -i.bak '10d;11d;12d' *.desktop
TIP: In case you still have problems, and need to do settings
-> open console and type "xfce4-settings-manager"
11. Set polkit right so you can reboot and shutdown in xour RDP Session
Link: HowTo set polkit right for XRDP Shutdown and Reboot CLICK ME
Code:
nano /usr/share/polkit-1/actions/org.freedesktop.login1.policy
<action id="org.freedesktop.login1.power-off-multiple-sessions">
<description>Power off the system while other users are logged in</description>
<message>Authentication is required for powering off the system while other users are logged in.</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.power-off</annotate>
</action>
and a bit beow
Code:
<action id="org.freedesktop.login1.reboot-multiple-sessions">
<description>Reboot the system while other users are logged in</description>
<message>Authentication is required for rebooting the system while other users are logged in.</message>
<defaults>
<allow_any>yes</allow_any>
<allow_inactive>yes</allow_inactive>
<allow_active>yes</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.imply">org.freedesktop.login1.reboot</annotate>
</action>
12. Solve SNAP Problems in LXC with Proxmox -
I dunno if I really needed that, but iI installed it
Code:
sudo apt install squashfuse
Code:
lxc.apparmor.raw: mount,
lxc.mount.entry: /dev/fuse dev/fuse none bind,create=file 0 0
lxc.cap.drop:
lxc.cap.drop: mac_override sys_time sys_module sys_rawio
lxc.apparmor.profile: unconfined
13. check vapi support
Code:
sudo apt install vainfo
sudo vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Ivybridge Mobile - 2.4.0
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
14. (sorry i forgot)
Code:
sudo apt install xserver-xorg-video-intel
sudo mkdir /etc/X11/xorg.conf.d/
sudo nano /etc/X11/xorg.conf.d/20-intel.conf
##ADD Following
Section "Device"
Identifier "Intel Graphics"
Driver "intel"
Option "AccelMethod" "sna"
Option "TearFree" "true"
EndSection
#SAVE&EXIT
inxi -G
Graphics:
Device-1: Intel 3rd Gen Core processor Graphics driver: i915 v: kernel
Display: x11 server: X.Org 1.20.8 driver: intel resolution: 1920x1080~50Hz
OpenGL: renderer: llvmpipe (LLVM 10.0.0 256 bits) v: 3.3 Mesa 20.0.8
^^ if it shows that, Xorg is runing on intel
TIP: In case you wann run GTK (GUI) programs as sudo/root
Code:
export XAUTHORITY="$XDG_RUNTIME_DIR"/Xauthority
xhost +SI:localuser:root
xhost +SI:localuser:morpheus
NOW connect with any RDP Client to your VM and enjoy the GPU working with your Desktop Enviroment and you can use your CPU power for more useful stuff.
I hope the tuorial is exact and you can have some fun - BTW you can use your hypervisor now to watch movies on your TV for example if you install x11vnc
(UPDATE 25.09.2020)
Tests:
1920 x 1080@25Hz Youtube Video with 0 Drops out of 1000 with 30% utilization @ 2 x 2,1 GHz cores
2560 x 1440@25Hz Youtube Video with 1 Drop out of 1000 with 67% utilization @ 2 x 2,1 GHz cores
3840 x 2160@25Hz Youtube Video with 30 Drops out of 1000 with 100% utilization @ 2 x 2,1 GHz cores (i could give th LXC Container mores cores now, but I do not really ned 4k right now)
+ XRDP is using some CPU for the transfer - i would be still lag free on the HDMI Output of the server.
Cheers PSteinberg
Last edited: