Build ubuntu vncserver

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.