Escolar Documentos
Profissional Documentos
Cultura Documentos
04
Tutorial search
Author: howtoforge
This tutorial exists for these OS Tags: desktop, linux, ubuntu
versions
On this page
Tweet
1 Preliminary Note
2 VNC Server Installation Recommend 13
3 Adding VNC user
4 VNC Client
1 Preliminary Note
1 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
IP address 192.168.0.100
Gateway 192.168.0.1
DNS 8.8.8.8 8.8.4.4
Hostname server1.example.com
VNC-server benefits
2 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
4.1.1+xorg4.3.0-37ubuntu5
amd64 Virtual network
computing server software
root@vboxtest ~ #
3 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
adduser srijan
4 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
su - srijan
vncserver
srijan@server1:~$ vncserver
srijan@server1:~$
cp ~/.vnc/xstartup ~/.vnc/xstartup.bak
> ~/.vnc/xstartup
vi ~/.vnc/xstartup
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &
5 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
x
s
e
t
r
o
o
t
-
s
o
l
i
d
g
r
e
y
v
n
c
c
o
n
f
i
g
-
i
c
o
n
i
c
&
vncserver -kill :1
6 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
su
vi /etc/init.d/vncserver
#!/bin/bash
unset VNCSERVERARGS
VNCSERVERS=""
[ -f /etc/vncserver/vncservers.conf ]
&& . /etc/vncserver/vncservers.conf
prog=$"VNC server"
start() {
. /lib/lsb/init-functions
REQ_USER=$2
echo -n $"Starting $prog: "
ulimit -S -c 0 >/dev/null 2>&1
RETVAL=0
for display in ${VNCSERVERS}
do
export USER="${display##*:}"
if test -z "${REQ_USER}" -o "${REQ_US
ER}" == ${USER} ; then
echo -n "${display} "
unset BASH_ENV ENV
DISP="${display%%:*}"
export VNCUSERARGS="${VNCSERVERARGS[$
{DISP}]}"
su ${USER} -c "cd ~${USER} && [ -f .v
nc/passwd ] && vncserver :${DISP} ${VN
CUSERARGS}"
fi
done
}
stop() {
. /lib/lsb/init-functions
REQ_USER=$2
echo -n $"Shutting down VNCServer: "
for display in ${VNCSERVERS}
do
export USER="${display##*:}"
if test -z "${REQ_USER}" -o "${REQ_US
ER}" == ${USER} ; then
echo -n "${display} "
unset BASH_ENV ENV
export USER="${display##*:}"
su ${USER} -c "vncserver -kill :${dis
play%%:*}" >/dev/null 2>&1
fi
done
echo -e "\n"
echo "VNCServer Stopped"
}
7 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
case "$1" in
start)
start $@
;;
stop)
stop $@
;;
restart|reload)
stop $@
sleep 3
start $@
;;
condrestart)
if [ -f /var/lock/subsys/vncserver ];
then
stop $@
sleep 3
start $@
fi
;;
status)
status Xvnc
;;
*)
echo $"Usage: $0 {start|stop|restart|c
ondrestart|status}"
exit 1
esac
chmod +x /etc/init.d/vncserver
mkdir -p /etc/vncserver
vi /etc/vncserver/vncservers.conf
VNCSERVERS="1:srijan"
VNCSERVERARGS[1]="-geometry 1024x768"
8 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
reboot
4 VNC Client
9 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
10 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
vi /etc/vncserver/vncservers.conf
[..]
VNCSERVERS="2:kishore"
VNCSERVERARGS[2]="-geometry 1024x768"
Recommend 13
38 Comment(s)
Add comment
Name * Email *
11 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
Comments
12 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
From: me Reply
13 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
...
...
...
Wow... Speechless. Im absolutely speechless.
** starting up windows 7 **
Nathan
14 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
--command:
myuser@myserver:~$ service vncserver start
-- result:
Starting VNC server: 1:myuser Password:
A VNC server is already running as :1
-- command: myuser@myserver:~$ service
vncserver stop
hi,
why if I add a second user following the
instructions in this guide TightVNC and
VNCviewer give me this error: Error in
TightVNC Viewer: Unable to establish
connection . Persistent refusal of the target
computer. ?????
This error is given to me also in the first user,
that work correctly before I've put the second
15 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
user!!!!
If I delete the second user, the first user return
to work correctly!!!
any advice???
thanks!
ubuntino88
16 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
undo everything:
vncserver -kill :# (where # is the
current vncserver running)
rm ~/.vnc/xstartup
rm /etc/vncserver/vncservers.conf
rm /etc/init.d/vncserver
update-rc.d -f vncserver remove
apt-get remove --purge vnc4server
apt-get autoremove
(just in case)
mv ~/.vnc/xstartup.bak ~/.vnc/xstartup
Still gnome-core, xfce4 and firefox installed
initially will remain, it is up to you if you want
to remove them as well, those won't harm
anyway.
Is not my intention to explain the above
commands, just list the set of steps required to
undo the install procedure proposed here.
It is supposed that users come here knowing a
little bit of Linux
17 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
Hi,
I followed these steps, But for me, getting a
gray screen only. How can fix this ?
18 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
19 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
20 of 21 2/10/2017 3:27 PM
How To Install VNC Server On Ubuntu 14.04 https://www.howtoforge.com/how-to-install-vnc-server-on-ubuntu-14.04
21 of 21 2/10/2017 3:27 PM