Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Auto Install gnome & VNC Server.

Posted on 2010-11-14
9
Medium Priority
?
562 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
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 

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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
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 …
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Suggested Courses

609 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