How to install VNC Server in OpenVZ VPS container (Ubuntu, Debian or CentOS)

Hello, 
You can check this script to setup a VNC server in OpenVZ containers.

Simple steps:

 - Run the command via SSH logged with root user.

- During the process, you will be asked to setup your VNC password

- At the end, the VPS will reboot

- When starts, connect using your VNC client, using your VPS IP and the port 1 (Ex: 192.168.20.20:1)

- Caution! You're logged as root, the server won't ask you for sudo escalation provileges.
T
ake care about what you run on the VPS or on what websites you will navigate using the browser.

Ubuntu 12.04 - x86 and x86_64

apt-get update -y;
apt-get upgrade -y;
apt-get install nano -y;
apt-get install gnome-core firefox flashplugin-installer -y;
apt-get install vnc4server -y; vncserver; vncserver -kill :1;
cd
~; wget https://ginernet.com/downloads/vnc-ubuntu-12.txt -O .vnc/xstartup;
mkdir -p /etc/vncserver;
echo 'VNCSERVERS="1:root"' >> /etc/vncserver/vncservers.conf;
echo 'VNCSERVERARGS[1]="-geometry 1000x700"' >> /etc/vncserver/vncservers.conf;
cd /etc/init.d/;
wget https://ginernet.com/downloads/vnc-init-ubuntu-12.txt -O vncserver; chmod 755 vncserver;
update-rc.d vncserver defaults 99;
reboot;


Debian 7 - x86 and x86_64

apt-get update -y;
apt-get upgrade -y;
apt-get install nano -y;
apt-get install gnome-core flashplugin-nonfree -y;
apt-get install vnc4server -y; vncserver; vncserver -kill :1;
cd
~; wget https://ginernet.com/downloads/vnc-debian-7.txt -O .vnc/xstartup;
mkdir -p /etc/vncserver; echo 'VNCSERVERS="1:root"' >> /etc/vncserver/vncservers.conf;
echo 'VNCSERVERARGS[1]="-geometry 1000x700"' >> /etc/vncserver/vncservers.conf; cd /etc/init.d/;
wget https://ginernet.com/downloads/vnc-init-ubuntu-12.txt -O vncserver; chmod 755 vncserver;
update-rc.d vncserver defaults 99;
reboot;


CentOS 6 - x86_64 (not valid for 32 bit)

yum install nano -y;
yum update
-y;
yum upgrade
-y;
yum install tigervnc-server -y;
yum groupinstall "Desktop"-y; yum install firefox -y;
rpm -ivh http://linuxdownload.adobe.com/adobe-release/adobe-release-x86_64-1.0-1.noarch.rpm;
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux;
yum install flash-plugin nspluginwrapper alsa-plugins-pulseaudio libcurl -y;
echo 'echo "nameserver 8.8.8.8" >> /etc/resolv.conf; ' >> /etc/rc.local;
echo 'VNCSERVERS="1:root"' >> /etc/sysconfig/vncservers;
echo 'VNCSERVERARGS[1]="-geometry 1000x700"' >> /etc/sysconfig/vncservers; vncpasswd;
chkconfig vncserver on --level 345;
reboot;

 
Credits: jmginer @ VPSB

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I reboot my VPS server?

Hi,You can reboot your VPS by passing the following command in Putty or Terminalreboot

How do I enable PPP?

You Can Login to SolusVM Panel -> Enable PPP.Please be sure to raise a Support Ticket...

Changing VPS Timezone?

Generic procedure to change timezone under Linux Cd to /etc, run:# cd /etcCreate a symlink...

How do I enable Tun/Tap?

You Can Login to SolusVM Panel -> Enable Tun/Tap.Please be sure to raise a Support Ticket...

How to Reinstall the Operating System?

You can reinstall OS in few clicks.1) Login on SolusVM URL2) Click on Reinstall from Option3)...

Powered by WHMCompleteSolution