'How do I fix a blank white screen for Visual Studio Code run remotely through X11?

Visual Studio Code displays perfectly from a local display on a Ubuntu 20 installation, but just produces a blank white window when run from a remote Ubuntu machine through X-windows. Running code --disable-gpu doesn't help. Other applications such as Firefox, Nautilus, and Eclipse display remotely with no problem.

Any suggestions?



Solution 1:[1]

There is an issue for this upstream: https://github.com/microsoft/vscode/issues/110119

Running code --verbose --log debug --disable-gpu prints, among others:

[3440:1116/110926.098706:WARNING:x11_util.cc(1520)] X error received: serial 169, error_code 1 (BadRequest (invalid request code or no such operation)), request_code 130, minor_code 1 (X_ShmAttach)
[3440:1116/110926.129228:WARNING:x11_util.cc(1520)] X error received: serial 170, error_code 1 (BadRequest (invalid request code or no such operation)), request_code 130, minor_code 1 (X_ShmAttach)
[3440:1116/110926.170878:WARNING:x11_util.cc(1520)] X error received: serial 171, error_code 1 (BadRequest (invalid request code or no such operation)), request_code 130, minor_code 3 (X_ShmPutImage)
[3440:1116/110926.204224:WARNING:x11_util.cc(1520)] X error received: serial 172, error_code 1 (BadRequest (invalid request code or no such operation)), request_code 130, minor_code 3 (X_ShmPutImage)

I don't know much about X, but I would expect X shared memory (shm) to not work via X forwarding, and maybe it's something that vscode currently needs?

Solution 2:[2]

For me the "--disable-extensions --disable-gpu" options worked.

Solution 3:[3]

Just install an old version of VS Code.

I use version 1.59.1 and I don't have a white screen anymore when I use sudo.

Solution 4:[4]

It looks like it started in rev 1.66 on my Linux systems.

I uninstalled and installed 1.65 from here:

https://code.visualstudio.com/updates/v1_65

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 bmakos
Solution 3 Gino Mempin
Solution 4 Michael Moy