Reply To: Persistent screen resolution on headless EC2

NoMachine for Linux / Persistent screen resolution on headless EC2 / Reply To: Persistent screen resolution on headless EC2

#7253
csh1csh1
Participant

I’d like to clarify why I used display :1 and not :0 as the link recommends. I did it because of errors. Here’s what I’ve done:

1. Reboot.

2. Typed the following:
$ sudo apt-get install xvfb
$ COOKIE=ps -ef | md5sum | cut -f 1 -d ” ”
$ AUTHFILE=$HOME/Xvfb-0.auth
$ xauth -f $AUTHFILE add :0 MIT-MAGIC-COOKIE-1 $COOKIE
(got “xauth: file /home/ubuntu/Xvfb-0.auth does not exist”, disregarded it)
$ xauth add :0 MIT-MAGIC-COOKIE-1 $COOKIE
(got “xauth: file /home/ubuntu/.Xauthority does not exist”, disregarded it)
$ Xvfb :0 -auth $AUTHFILE -screen 0 1800x1200x24 &

At this step I got
Fatal server error:
(EE) Server is already active for display 0
If this server is no longer running, remove /tmp/.X0-lock
and start again.

I assumed that X+GNOME which I installed earlier (and which work beautifully with NoMachine at 1024×768 resolution) had already started after the reboot, so DISPLAY :0 was already in use when I typed the above shell commands.

Any help on how to increase the resolution would be greatly appreciated. Thanks!!