Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Advertise on LowEndTalk.com
How to install VNC Server in OpenVZ VPS container (Ubuntu, Debian or CentOS)
New on LowEndTalk? Please read our 'Community Rules' by clicking on it in the right menu!

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

jmginerjmginer Member, Provider
edited May 2014 in Tutorials

Hello, we have created some "scripts" to setup a VNC server in OpenVZ containers.
I think someone can be interested to know it.

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. Take 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 - View source

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 - View source

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) - View source

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;
Voxility DDoS protected BGP starting from 250 EUR/month. Contact us.
VPS in Spain ☛ 5.99€/month ★ We accept Bitcoins! ★ DMCA ignore ★

Comments

  • Really helpful :P I saw this a minute before i should google it :P

    Thanked by 1jmginer
  • derpderp Member

    You had me until "apt-get install nano"...

    Thanked by 2jmginer msg7086
  • ehabehab Member

    I don't know how long i can resist the urge to get a vps in Spain.

    Thanked by 1jmginer
    • do not prepay > 1 year and check for reviews/support
    • only use monthly from a provider operating < 1 year 🍆
  • DewlanceVPSDewlanceVPS Member
    edited May 2014



    I think you don't need to reboot VPS, just stop/start vncserver.

    Thanked by 1jmginer
    Dewlance
  • @jmginer said:

    You might want to use block code quotes (< pre >) instead of the backticks, as the backticks screw up successive lines pretty badly.

    Thanked by 1jmginer

    Acting Director of Albino Geek Services Ltd. My Keybase ID ( gh )
    GoodHosting.co | Enterprise KVM Virtual Private Servers | Twitter / Status : @ GoodHostingCo

  • jmginerjmginer Member, Provider
    edited May 2014

    @derp, I install allways if is not :)

    @ehab, Still I have stock, you can wait more ;)

    @DewlanceVPS, Just to check that everything starts ok after a reboot

    @GoodHosting, Fixed, thanks

    Voxility DDoS protected BGP starting from 250 EUR/month. Contact us.
    VPS in Spain ☛ 5.99€/month ★ We accept Bitcoins! ★ DMCA ignore ★
  • joereidjoereid Member

    @ehab said:
    I don't know how long i can resist the urge to get a vps in Spain.

    Same, I got one about a week ago...

  • Great article thanks for the info :)

  • apt-get install xfce4 iceweasel mc p7zip xrdp
    

    Debian rulz :)

    Extremist conservative user, I wish to preserve human and civil rights, free speech, freedom of the press and worship, rule of law, democracy, peace and prosperity, social mobility, etc. Now you can draw your guns.

  • @ehab said:
    I don't know how long i can resist the urge to get a vps in Spain.

    I was about to buy the 9.99 deal the other day and then got put off when it added 20%VAT!

  • ehabehab Member

    @asterisk14 said:

    that happens to me a lot, ahhhwell ... its part of living in the eu so don't let it spoil the fun :)

    • do not prepay > 1 year and check for reviews/support
    • only use monthly from a provider operating < 1 year 🍆
  • You should look at x2go, much less lag, copy pasting, supports resizing the window while changing the resolution and works over SSH with keyfiles - a lot more secure.

    P.S. Are your VPS's in bcn1.ovz1 DDoS protected?

  • NekkiNekki Moderator

    asterisk14 said: I was about to buy the 9.99 deal the other day and then got put off when it added 20%VAT!

    Yar, his services definitely aren't worth the additional €2.

    Here lies Nekki. He loved massive amounts of storage, K-Pop and calling people cunts.

  • I think he means he should not have to pay VAT, so it is a matter of principle.

    Extremist conservative user, I wish to preserve human and civil rights, free speech, freedom of the press and worship, rule of law, democracy, peace and prosperity, social mobility, etc. Now you can draw your guns.

  • NekkiNekki Moderator

    Maounique said: I think he means he should not have to pay VAT, so it is a matter of principle.

    No, I'm fairly sure this young man resides in a country where VAT is payable.

    Here lies Nekki. He loved massive amounts of storage, K-Pop and calling people cunts.

  • Hm, I thought he is from Egypt or something?

    Extremist conservative user, I wish to preserve human and civil rights, free speech, freedom of the press and worship, rule of law, democracy, peace and prosperity, social mobility, etc. Now you can draw your guns.

  • NekkiNekki Moderator

    Maounique said: Hm, I thought he is from Egypt or something?

    I was referring to @asterisk14 and from some of the language he uses, I'm fairly sure he's from the UK.

    Here lies Nekki. He loved massive amounts of storage, K-Pop and calling people cunts.

  • asterisk14asterisk14 Member
    edited May 2014

    @Maounique said:
    Hm, I thought he is from Egypt or something?

    Masri? Me? La! Ana min Al-Bakistan.

  • asterisk14 said: Masri? Me? La! Ana min Al-Bakistan.

    Nekki said: I was referring to @asterisk14 and from some of the language he uses, I'm fairly sure he's from the UK.

    Nope, we were both wrong :P

    Extremist conservative user, I wish to preserve human and civil rights, free speech, freedom of the press and worship, rule of law, democracy, peace and prosperity, social mobility, etc. Now you can draw your guns.

  • NekkiNekki Moderator

    Maounique said: Nope, we were both wrong :P

    I wasn't.

    Here lies Nekki. He loved massive amounts of storage, K-Pop and calling people cunts.

  • TarZZ92TarZZ92 Member

    fyi

    Killing Xvnc4 process ID 3300
    --2014-05-27 12:38:09-- https://ginernet.com/downloads/vnc-debian-7.txt
    Resolving ginernet.com (ginernet.com)... 2a03:c7c0:1:1000::2, 5.134.117.67
    Connecting to ginernet.com (ginernet.com)|2a03:c7c0:1:1000::2|:443... connected.
    ERROR: The certificate of ginernet.com' is not trusted. ERROR: The certificate ofginernet.com' hasn't got a known issuer.
    --2014-05-27 12:38:09-- https://ginernet.com/downloads/vnc-init-ubuntu-12.txt
    Resolving ginernet.com (ginernet.com)... 2a03:c7c0:1:1000::2, 5.134.117.67
    Connecting to ginernet.com (ginernet.com)|2a03:c7c0:1:1000::2|:443... connected.
    ERROR: The certificate of ginernet.com' is not trusted. ERROR: The certificate ofginernet.com' hasn't got a known issuer.
    update-rc.d: using dependency based boot sequencing

    I AM BACK :)
    Working Windows Server 2012 R2 on 6GB! Beat that!

  • asterisk14asterisk14 Member
    edited May 2014

    @Nekki said: No, I'm fairly sure this young man resides in a country where VAT is payable.

    I think we should have LET tax-avoidance ring going like big businesses such as Google and Amazon have. What we should do is get non-EU residents to buy EU VPS tax free and transfer them to EU citizens afterwards and the EU citizens do likewise for USA citizens. We all save a few more $$ :-) and we can be happy that less tax money = less war funding for our governments regimes in USA/UK.

  • jmginerjmginer Member, Provider

    @TarZZ94

    Please, try to force using IPv4:

    Change: https://ginernet.com

    for: http://ipv4.ginernet.com

    Voxility DDoS protected BGP starting from 250 EUR/month. Contact us.
    VPS in Spain ☛ 5.99€/month ★ We accept Bitcoins! ★ DMCA ignore ★
  • jmginerjmginer Member, Provider
    edited May 2014

    @linuxthefish said: P.S. Are your VPS's in bcn1.ovz1 DDoS protected?

    No, we do blackhole

    Thanked by 1linuxthefish
    Voxility DDoS protected BGP starting from 250 EUR/month. Contact us.
    VPS in Spain ☛ 5.99€/month ★ We accept Bitcoins! ★ DMCA ignore ★
  • Very well written.Simple steps.

  • Script is broken on Debian/Ubuntu sadly:

  • @Infinity580 you may have missing packages and wrong xstartup file config http://www.namhuy.net/3106/install-vnc-server-ubuntu-14-04.html#comment-843

  • @Infinity580 can you tell me what you have done so far?

  • NeoonNeoon Member
    edited October 2014

    @namhuy that what is mentioned in your URL, all packages are installed and i replaced the xstartup with this.

  • well, I assume you have gnome, try xfce instead so you won't have to deal with grey screen

    # apt-get install xubuntu-desktop xfce4 firefox nano -y

    and modify your xstartup file again to load xfce

    #!/bin/sh
    unset SESSION_MANAGER
    unset DBUS_SESSION_BUS_ADDRESS
    startxfce4 &
    
    [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
    [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
    xsetroot -solid grey
    vncconfig -iconic &
    

    don't forget to reboot your box

    Thanked by 1Neoon
  • jmginerjmginer Member, Provider

    @Infinity580 is for Ubuntu 12.04, not other version.

    Voxility DDoS protected BGP starting from 250 EUR/month. Contact us.
    VPS in Spain ☛ 5.99€/month ★ We accept Bitcoins! ★ DMCA ignore ★
  • @jmginer The last one was Ubuntu 12.04 yes but Debian 7 didnt worked on 2 different vps's and dedis.

  • jmginerjmginer Member, Provider

    @Infinity580 Just tested in a clean OpenVZ server installed with the Debian 7 64bit official template, and all is fine...

    Voxility DDoS protected BGP starting from 250 EUR/month. Contact us.
    VPS in Spain ☛ 5.99€/month ★ We accept Bitcoins! ★ DMCA ignore ★
  • I had a also a clean installation, however thanks to @namhuy it worked.

    Thanked by 1namhuy
  • VPSRAIDSolutionsVPSRAIDSolutions Member without signature
    edited October 2014

    I have my own script which installs apache mysql php vnc gnome configures the scripts and changes web directory from /var/www/ to /root/public_html , It was made for a game server based installation but thats only 3 folders so you can delete that.

    wget vpsraid.com/install && chmod 777 install && bash install

    to be used on fresh ubuntu 12.04 LTS vps only

    it generates its own mysql password btw ( took the generating script from feathurvm )

  • cloromorphocloromorpho Member
    edited October 2014

    Exelente servicio @jmginer, estoy muy satisfecho con mi VPS.

    \:D/

    Thanked by 1jmginer

    Hello, my name is Cloromorpho and i am a LEB addict.

  • jmginer sir is this possible for KVM based? or really for OVZ based only?

  • @VPSRAIDSolutions said:
    I have my own script which installs apache mysql php vnc gnome configures the scripts and changes web directory from /var/www/ to /root/public_html , It was made for a game server based installation but thats only 3 folders so you can delete that.

    it generates its own mysql password btw ( took the generating script from feathurvm )

    sir can you also share, like sir jmginer did installation for phpmyadmin i am looking to try for it for my test vps for game server based installation

  • looking forward to debian and centos guide sir vpsraidsolution thanks in advanced :)

  • jvnadrjvnadr Member
    edited March 2015

    @neil413 What is this necro bump, with question-bombing? Oh, my!
    Anyway:
    1. You can install it in any virtualization, KVM icluded
    2. vpsraidsolutions is dead as business
    3. There are plenty of newer tutorials in LET (not to mention Google!) about setup and configuring vnc.

    Please, do not necro old threads without a valid reason.

  • thankyou very much for this (centos) script, it worked on my vps however all I have is a black rectangle with a browser window in it - I assume this is firefox from the script, and when I close the browser there are no application menus or anything, just a plain black rectangle and nothing to click on. How would I get these features into this desktop?

Sign In or Register to comment.