Solved

Auto Install gnome & VNC Server.

Posted on 2010-11-14
9
550 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This document is written for Red Hat Enterprise Linux AS release 4 and ORACLE 10g.  Earlier releases can be installed using this document as well however there are some additional steps for packages to be installed see Metalink. Disclaimer: I hav…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

867 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

19 Experts available now in Live!

Get 1:1 Help Now