Setup noVNC remote server that you can use via browser.

It looks like you’re attempting to install a VNC server on your Ubuntu system along with the GNOME desktop environment. However, there is a slight discrepancy in your command. Instead of “vnccserver,” it should be “vncserver.”

Here are the corrected steps:

Install TigerVNC Server and GNOME Desktop:

sudo apt update
sudo apt install tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer
sudo apt install ubuntu-gnome-desktop

Start GNOME Desktop

sudo systemctl enable gdm
sudo systemctl start gdm

Start VNC Server

vncserver

When you run the vncserver command, it will prompt you to set a password for VNC access. After setting the password, it will start the VNC server on display :1.

Note:

  • The dbus-launch: not found error may indicate that the dbus-launch command is missing. You might consider installing the dbus-x11 package to resolve this

    sudo apt-get install dbus-x11

To address this warning, you can set the XDG_CURRENT_DESKTOP environment variable explicitly in your VNC xstartup script. Edit your xstartup script:

nano /root/.vnc/xstartup

Add the following line at the beginning of the script:

export XDG_CURRENT_DESKTOP=GNOME

So, your modified xstartup script will look like:

#!/bin/sh
export XDG_CURRENT_DESKTOP=GNOME
# Start Gnome 3 Desktop
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -f $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-run-session gnome-session &
 

Save the file and make it executable:

chmod +x /root/.vnc/xstartup

 

Save the file and restart the VNC server

vncserver -kill :1
vncserver
 To Run VNC wirte this command

/root/noVNC/utils/novnc_proxy –vnc localhost:5901 –listen 80

2nd deisplay
vncserver :2 -geometry 1920×1080
/root/noVNC/utils/novnc_proxy –vnc localhost:5902 –listen 81

 
 
  1. Reset VNC Password:

    • If you suspect that the password might be incorrect or if you’ve forgotten it, you can reset the VNC password by running the following command:
      vncpasswd

      This command will prompt you to enter and confirm a new VNC passworExamine the VNC server logs for any error messages or warnings that might provide insights into the authentication issue.

    • tail /root/.vnc/ip-172-26-3-214.ec2.internal:5901.log

  2. Verify VNC Server Status:

    • Ensure that the VNC server is running. You can use the following command to check the status:
      vncserver -list

      If the server is not running, you may need to start it with

      vncserver
  3. Sometimes, restarting the VNC server can resolve authentication issues.

    • vncserver -kill :1
      vncserver
  4.  

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top