Build ubuntu vncserver
Ubuntu 16.04 configuration VNCSERVER author kf92 follow 2016.09.19 20:18 * Word Count 384 read 565 comments 0 like 0
#! /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 /. xresourcesxsetroot-solid gray vncconfig-iconic & x-terminal-emulator-geometry 80x24 + 10 + 10-ls-title "$ vnc1_topdesktop" & x-window-manager & gnome-panel & gnome-settings-daemon & metacity & nautilus & first install:
Sudo apt install xfce4 xfce4-goodies tightvncserver
Sudo apt-get install vnc4server
After installation, run:
Vnc4server
Enter the password and confirm,
At this time ,~ /. Vnc/to generate the xstartup file.
Back up the startup file:
Mv ~ /. Vnc/xstartup ~ /. Vnc/xstartup. bak
Run:
Vncserver-kill: 1
Kill the started process, where 1 corresponds to the process when vnc4server was created.
Then, modify the xstartup
Vim ~ /. Vnc/xstartup
The content is as follows:
#! /Bin/bash
Xrdb $ HOME/. Xresources
Startxfce4 &
Modify the xstartup permission:
Chmod + x ~ /. Vnc/xstartup
After the configuration is complete, start vncserver:
Vncserver
Appendix 1: Unity Style
Installation package:
Sudo apt-get install -- no-install-recommends ubuntu-desktop gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
Sudo apt-get install vnc4server
Corresponding xstartup file:
[-X/etc/vnc/xstartup] & exec/etc/vnc/xstartup
[-R$ HOME/. Xresources] & xrdb $ HOME/. Xresources
Xsetroot-solid gray
Vncconfig-iconic &
X-terminal-emulator-geometry 80x24 + 10 + 10-ls-title "$ vnc1_topdesktop "&
X-window-manager &
Gnome-panel &
Gnome-settings-daemon &
Metacity &
Nautilus &
Appendix 2 start VNCSERVER with startup:
Sudo vim/etc/systemd/system/vncserver @. service
Create the following content:
[Unit]
Description = Start TightVNC server at startup
After1_syslog.tar get network.tar get
[Service]
Type = forking
User =Yourusername
PAMName = loginPIDFile =/home/Yourusername/. Vnc/% H: % I. pid
ExecStartPre =-/usr/bin/vncserver-kill: % I>/dev/null 2> & 1
ExecStart =/usr/bin/vncserver-depth 24-geometry 1280x800: % I
ExecStop =/usr/bin/vncserver-kill: % I ?install=wantedby=multi user.tar get
Run:
Sudo systemctl daemon-reload
Sudo systemctl enable vncserver@1.service
If the vncserver is running, stop running it.
Sudo systemctl start vncserver @ 1
Sudo systemctl status vncserver @ 1