Score:1

Visual Studio Code shows a blank screen while trying to run it as superuser

pt flag

I tried to run VSCode as root. It actually launched successfully, but it shows just a blank screen.

Screenshot of the problem

I tried running it as superuser via the command sudo code /var/www/html --user-data-dir='.' --no-sandbox

Also is there a way to open VSCode as superuser automatically without typing any commands every time?

Jeff Schaller avatar
ru flag
Did you intend to run `code code`?
syrok avatar
pt flag
@JeffSchaller just mistyped, nothing changes if I use "code"
cn flag
You are not supposed to run it using `sudo` `sudo` is for maintenance of your system. Not for coding. Please learn and use proper safe methods to alter files. That means no `sudo`. There is zero reason to do so and there is a high risc of breaking your system. If you create a website on that system set it up properly so your user is part of the apache system.
Score:0
mm flag

As a workaround, version 1.59 of vscode can be run as root without getting the white screen. In another thread it was posted that the white screen when operating as root started occurring at version 1.66, and that version 1.65 still works.

cn flag
There is no need and as you can install extensions from inside vscode this could mess up your system.
Score:-1
re flag

Try

sudo -i

Then

code /var/www/html 
jp flag
Hi there, please provide some context about why you think running VSCode as super user will fix this problem. A link to documentation would be great too.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.