INSTALL VNC SERVER ON CENTOS 7

FROM COMMAND LINE TO GRAPHICAL UI

install gnome on your server

$ sudo yum groups install “GNOME Desktop”

Note:  We assume you install VNC Viewer Client on your MAC or PC, just google it

INSTALL VNC SERVER

$ sudo yum install tigervnc-server
$ sudo cp /lib/systemd/system/vncserver\@.service /etc/systemd/system/vncserver@:1.service

edit <USER> as msen or whatever your username is

$ sudo vi /etc/systemd/system/vncserver\@\:1.service

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
# Clean any existing files in /tmp/.X11-unix environment
ExecStartPre=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’
ExecStart=/usr/sbin/runuser -l <USER> -c “/usr/bin/vncserver %i”
PIDFile=/home/<USER>/.vnc/%H%i.pid
ExecStop=/bin/sh -c ‘/usr/bin/vncserver -kill %i > /dev/null 2>&1 || :’

[Install]
WantedBy=multi-user.target

enable vnc for firewall

$ sudo firewall-cmd  –permanent   –zone=public  –add-service vnc-server
$ sudo firewall-cmd  –reload

still under msen user run simply vncserver, enter our specific password

$ vncserver
$ sudo systemctl daemon-reload
$ sudo systemctl enable vncserver@:1.service
$ sudo reboot
$ sudo systemctl start vncserver@:1.service
$ sudo systemctl status vncserver@:1.service

go to vnc client and call 10.10.1.40:5901  (whatever your ip is) and verify you go with unencrypted, enter your authentication password and also user password

ADDITIONAL USERS

in case you need to add additional users

$ sudo cp /lib/systemd/system/vncserver\@.service /etc/systemd/system/vncserver@:2.service
edit new as blabla
$ sudo vi /etc/systemd/system/vncserver\@\:2.service
login as new user if root and run the vncserver, enter vnc password for that user
$ su – blabla
$ vncserver
$ sudo systemctl daemon-reload
$ sudo systemctl enable vncserver@:2.service
$ sudo reboot
$ sudo systemctl start vncserver@:2.service
$ sudo systemctl status vncserver@:2.service

 

YEEYYYY!!!!

 

No need for now because you run this when you install only standalone shell and want to go to graphical UI
================================================================================
current default target is

$ sudo systemctl get-default
multi-user.target

change to graphical

$ sudo systemctl set-default
graphical.target

================================================================================

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s