Alexander Demidov
Alexander Demidov

Reputation: 101

Xvfb on DISPLAY :0 and connect Xsession to DISPLAY :0 from chroot

My situation: Host computer on ArchLinux. And launched inside chroot-enviornment (ArchLinux) with systemd-nspawn container technology.

I need connect nomachine client to chrooted system.

I have simple script

#!/bin/sh
COOKIE=`ps -ef | md5sum | cut -f 1 -d " "`
sudo xauth -f /var/run/Xvfb-0.auth add :0 MIT-MAGIC-COOKIE-1 $COOKIE
xauth add :0 MIT-MAGIC-COOKIE-1 $COOKIE
Xvfb :0 -auth /var/run/Xvfb-0.auth -screen 0 1680x1050x24 &
DISPLAY=:0 /etc/X11/Xsession startxfce4 &

That script - true way to activate frame buffer on DISPLAY=:0 and connect to X11 session with new release of nomachine client (4+)

But that script unable to work in chroot. Xvfb and startxfce4 started fine, but nomachine client says me - sessions on remote server not found.

I try to start Xvfb on host system and connect to host DISPLAY=:0 from chroot-container - poorly. Problem with auth mit magik cookies.

In fact - I do not understand how work my simple script. Can anybody explained to how this code works?

How activate X11 session on DISPLAY=:0 from chroot (systemd-nspawn, ArchLinux). And connect to that session from nomachine client (nomachine.com, version >= 4)?

Upvotes: 0

Views: 2128

Answers (1)

Alexander Demidov
Alexander Demidov

Reputation: 101

Problem with Invalid MIT-MAGIC-COOKIE solved with

rm ~/.Xauthority && touch ~/.Xauthority

Nomachine says "No session on remote resver". You need to restart nomachine server after create Xvf display.

/usr/NX/bin/nxserver --restart

Upvotes: 0

Related Questions