"Couldn't get a file descriptor referring to the console" through SSH, Ubuntu 20.04 (Focal)

2.8k Views Asked by At

I am trying to run headless X on Ubuntu 20.04 (Focal). This is on a fresh Digital Ocean instance. I can't get it to work using Ubuntu 20.04, but I can with Ubuntu 18.04 (Bionic) and Ubuntu 20.10 (Groovy).

I am working from a user account that has sudo access, and I am SSH'ed in.

This works on Ubuntu 18.04 (Bionic) and Ubuntu 20.10 (Groovy):

sudo apt-get install -y xfce4 xfce4-goodies xfonts-base
# from https://unix.stackexchange.com/questions/478742/error-when-trying-to-use-xorg-only-console-users-are-allowed-to-run-the-x-serve
sudo perl -i -pe 's/allowed_users=.*/allowed_users=anybody/' /etc/X11/Xwrapper.config
startx

However it doesn't work on Ubuntu 20.04 (Focal). I get this error:

$ startx


X.Org X Server 1.20.8
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.15.0-124-generic x86_64 Ubuntu
Current Operating System: Linux ubuntu-s-1vcpu-1gb-nyc3-01 5.4.0-58-generic #64-Ubuntu SMP Wed Dec 9 08:16:25 UTC 2020 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-58-generic root=UUID=db153994-91fe-426f-bd88-f751e07f97f2 ro console=tty1 console=ttyS0
Build Date: 30 November 2020  05:56:33PM
xorg-server 2:1.20.8-2ubuntu2.6 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.38.4
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Mon Dec 21 04:27:42 2020
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
(II) [KMS] drm report modesetting isn't supported.
resizing surface0 to 16777216
memory space from 0x7f9ac0fe5000 to 0x7f9ac3fe2000
memory space from 0x7f9abefe5000 to 0x7f9abffe5000
resizing surface0 to 16777216
memory space from 0x7f9ac1009000 to 0x7f9ac4006000
memory space from 0x7f9abf009000 to 0x7f9ac0009000
ram_header at 67100672
surf0 size: 16777216
slots start: 1, slots end: 7
done reset
qxl_surface_create: Bad bpp: 1 (1)
qxl_surface_create: Bad bpp: 1 (1)
qxl_surface_create: Bad bpp: 1 (1)
xinit: connection to X server lost

waiting for X server to shut down Disabling FB access for 0
(II) Server terminated successfully (0). Closing log file.

Couldn't get a file descriptor referring to the console

If instead of:

sudo apt-get install -y xfce4 xfce4-goodies xfonts-base

I do:

sudo apt-get install -y xinit

it doesn't work on Ubuntu 20.04 (Focal) or Ubuntu 18.04 (Bionic) anymore. However, it does work on Ubuntu 20.10 (Groovy), as well as LambdaLabs instances which use a customized Ubuntu 20.04 (Focal) stack, just not Digital Ocean.

How can I get headless X running on Ubuntu 20.04 (Focal)?

I have checked stackoverflow and none of the answers appear to work for me.

0

There are 0 best solutions below