Solved

Auto Install gnome & VNC Server.

Posted on 2010-11-14
9
546 Views
Last Modified: 2012-05-10
Hi all,
I have recently had a request to develop a shell script that will take one standard "ubuntu" VPS and turn it into a Desktop system with VNC.

I have attached the code i come up with and using Expect for the VNC Password config which seems fine however shortly after wrighting the script i noticed that it requires user interaction.

Can anybody offer me a script that will install the desktop components and VNC Server. This is really confuzing me now and i need help.

my first expect script (apt-update.exp) answers a question about updating .conf files from distributor, Im not sure if theres a better way of doing this?

500 Points for the first with a working script please :)
cd /exapps

        ./apt-update.exp "$VEID" "N"



        # Install Desktop & VNC Server

        /usr/sbin/vzctl exec $VEID apt-get install -y gnome-desktop-environment xfonts-100dpi xfonts-100dpi-transcoded xfonts-75dpi xfonts-75dpi-transcoded xfonts-base vnc4server xinetd --fix-missing



        cd /exapps

        ./vncpass.exp "$VEID" "$VNCPASS"



        /usr/sbin/vzctl exec $VEID vncserver

Open in new window

0
Comment
Question by:vePortal
  • 5
  • 4
9 Comments
 
LVL 23

Expert Comment

by:savone
ID: 34132656
For user interaction you can use expect.

Are you familiar with perl or expect?
0
 

Author Comment

by:vePortal
ID: 34132670
I'm not familiar with either, I can about make-do with Expect however when installing the desktop utilities it asks you things like GEO Location, Keyboard layout etc, Both of which i have no idea how to pass the data onto it.
0
 
LVL 23

Expert Comment

by:savone
ID: 34132854
Well thats what expect does, you tell it to expect something (Like a password prompt) and then when it sees it, it then passes more info (like a password).

read more here:
http://search.cpan.org/~bnegrao/Net-SSH-Expect-1.09/lib/Net/SSH/Expect.pod

You can also look up expect, there is a ton of information on it on the net.  I can't write a script for you since I am not sure of what your trying to do or what questions would be asked.
0
 

Author Comment

by:vePortal
ID: 34132914
The problem i've got is that i was under the impression "Expect" was used to enter data/user interaction and when it prompts you for keyboard config etc etc it asks you to select from a list, not simply "Type in" data.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 23

Expert Comment

by:savone
ID: 34133118
if it is command line it should be asking you for a number like so:

1) option1
2) option2
3) option3

If you know what the options are you can use expect.

If you need to use the arrow keys to make a selection you can also use expect (depending on your environment of course)

up:    "\c[[A"
down:  "\c[[B"
left:  "\c[[D"
right: "\c[[C"

0
 

Author Comment

by:vePortal
ID: 34134554
I'm pretty sure that it auto-detects the country i.e. if you are in ukraine it will come up with ukrane and therefore theres no way of telling which way to move with the arrows, There has got to be some way of pre-entering the data or passing it via the commandline areguments.
0
 
LVL 23

Expert Comment

by:savone
ID: 34135783
Well thats a whole different question...

What VNC software and what distro are you using.  I do not have a lot of experience with VNC but the few times I have used it on Fedora or RedHat I was never asked for a country or anything else.  For Fedora TigerVNC works out of the box, install and start it.

0
 

Accepted Solution

by:
vePortal earned 0 total points
ID: 34136394
It will need to install on Debian and Ubuntu.

And the regional settings are from installing the gnome-desktop.
0
 

Author Closing Comment

by:vePortal
ID: 34886385
Sorted it myself.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now