How to start UBUNTU GUI on Azure Virtual machine

Joe 0 Reputation points
2024-02-08T16:05:34.0733333+00:00

I am having trouble launching the gui on UBUNTU Virtual Machine. I have the command line up, i've ran the commands for install the gui, when i run command **startx **It does not work. (here is a copy and paste of the command line) crab. rangoon1@outlook.com@Ubuntu:~$ startx /usr/lib/xorg/Xorg-wrap: Only console users are allowed to run the X server xinit: giving up xinit: unable to connect to X server: Connection refused xinit: server error Couldn't get a file descriptor referring to the console

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,968 questions
{count} votes

1 answer

Sort by: Most helpful
  1. vipullag-MSFT 26,316 Reputation points
    2024-02-08T16:18:53.3866667+00:00

    Hello Joe

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    It looks like you are trying to start the X server as a non-root user, which is not allowed by default on Ubuntu. You can try running the following command to allow non-root users to start the X server:

    sudo dpkg-reconfigure x11-common

    This will bring up a configuration dialog where you can select "Anybody" under "Console users" and then click "OK" to save the changes.

    After making this change, you should be able to start the X server as a non-root user by running the startx command again. If you still encounter issues, you can try running the command with the -- :1 option to start the X server on a different display:

    startx -- :1

    This will start the X server on display :1 instead of the default display :0. You can then connect to the X server using a VNC client or another remote desktop solution.

    Hope this helps.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.