How to Install a VNC Server in Ubuntu

  • 1

    Open a Terminal window. The Terminal window can be found under "Start" > "Utilities."

  • 2

    Download vnc4server and xinetd:
    sudo apt-get install vnc4server xinetd

  • 3

    Start the vnc4server:
    vnc4server

    You will be prompted for a password. This password will be used to log into the VNC session.

    After providing a password, you will get output that looks like:
    New 'laptop:3 (laptop)' desktop is laptop:3

    Take notice of the number after the colon (:), in this case it is "3."

    Starting the vnc4server will cause a .vnc directory to be placed in your home directory.

  • 4

    Stop the vnc4server
    vnc4server -kill :3

    Replace the number "3" with the number from Step 3.

  • 5

    Open the .vnc/xstartup file for editing:
    gedit ~/.vnc/xstartup

    The file will look like:
    #!/bin/sh
    # Uncomment the following two lines for normal desktop:
    #unset SESSION_MANAGER
    #exec /etc/X11/xinit/xinitrc
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    twm &

  • 6

    Change the .vnc/xstartup file and save it.

    Uncomment the lines that start with unset and exec. Comment out the lines that start with xsetroot, vncconfig, xterm and twm.

    The final file should look like:
    #!/bin/sh
    # Uncomment the following two lines for normal desktop:
    unset SESSION_MANAGER
    exec /etc/X11/xinit/xinitrc
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    #xsetroot -solid grey
    #vncconfig -iconic &
    #xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
    #twm &

  • 7

    Change the permissions on the /etc/X11/xinit/xinitrc file to make it executable:
    sudo chmod 755 /etc/X11/xinit/xinitrc

  • 8

    Start the vnc4server:
    vnc4server

    Again, remember the number after the colon (:).

  • 9

    Log into your remote desktop to check the configuration:
    vncviewer localhost:3

    Provide the password that you chose in Step 3.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值