Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 5165  / 2 Years ago, sat, november 5, 2022, 7:34:12

I've done the following but all I get in VNC Viewer is a blank orange screen, any help appreciated.




  1. apt-get -y install ubuntu-desktop tightvncserver


  2. adduser vnc && passwd vnc


  3. echo "vnc ALL=(ALL) ALL" >> /etc/sudoers


  4. sudo -u vnc vncpasswd


  5. nano ~/.vnc/xstartup and enter the following:





    #!/bin/sh
    # Uncomment the following two lines for normal desktop:
    unset SESSION_MANAGER
    . /etc/X11/xinit/xinitrc

    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
    #x-window-manager &


    save


  6. sudo nano /etc/init.d/vncserver, paste in the following, then save:



    #!/bin/sh -e
    ### BEGIN INIT INFO
    # Provides: vncserver
    # Required-Start: networking
    # Default-Start: 3 4 5
    # Default-Stop: 0 6
    ### END INIT INFO

    PATH="$PATH:/usr/bin/"

    # The Username:Group that will run VNC
    export USER="vnc"
    #${RUNAS}

    # The display that VNC will use
    DISPLAY="1"

    # Color depth (between 8 and 32)
    DEPTH="16"

    # The Desktop geometry to use.
    #GEOMETRY="<WIDTH>x<HEIGHT>"
    #GEOMETRY="800x600"
    GEOMETRY="1024x768"
    #GEOMETRY="1280x1024"

    # The name that the VNC Desktop will have.
    NAME="my-vnc-server"

    OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"

    . /lib/lsb/init-functions

    case "$1" in
    start)
    log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}"
    su ${USER} -c "/usr/bin/vncserver ${OPTIONS}"
    ;;

    stop)
    log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}"
    su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}"
    ;;

    restart)
    $0 stop
    $0 start
    ;;
    esac

    exit 0


    Then ctrl-x to save, Y for Yes, and enter to accept file name.


  7. chown -R vnc. /home/vnc/.vnc && chmod +x /home/vnc/.vnc/xstartup


  8. sed -i 's/allowed_users.*/allowed_users=anybody/g' /etc/X11/Xwrapper.config


  9. chmod +x /etc/init.d/vncserver && service vncserver start


  10. update-rc.d vncserver defaults


  11. reboot.


  12. finally, go in there with tightvnc viewer client, and voila, blank kool aid tangerine orange screen.



More From » unity

 Answers
5

you didn't set gui session for xstartup file, that is why you see blank screen when try try to remotely connect to your desktop/server via vnc on ubuntu, if you want gnome, install these packages



# apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal


and use this xstartup file



#!/bin/sh

export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &

gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

[#27143] Saturday, November 5, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
arkcker

Total Points: 296
Total Questions: 111
Total Answers: 104

Location: Nepal
Member since Tue, Sep 8, 2020
4 Years ago
;