?
Solved

Auto Install gnome & VNC Server.

Posted on 2010-11-14
9
Medium Priority
?
561 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

You ever wonder how to backup Linux system files just like Windows System Restore?  Well you can use Timeshift in Linux to perform those similar action.  This tutorial will show you how to backup your system files and keep regular intervals. Note…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
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.
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

764 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