Changes

From Amahi Wiki
Jump to: navigation, search
Reboot
{{Code|Code = sudo reboot now -h}}
From here on I used vim but you can use any editor you are comfortable with just replace vim with your choice.
Copy and paste
{{Code|Code = sudo apt-get update}}
when complete
{{Code|Code = sudo aptitude safe-upgrade}}
reboot server type
{{Code|Code = sudo reboot now -h}}
A: Install Gnome basic desktop.
First off we need to install the Gnome components for our virtual desktop. Type or copy and paste:
{{Code|Code = sudo apt-get install gnome-core}}
when prompted type Y and then press Enter. This will install the gnome desktop components.
Reboot
{{Code|Code = sudo reboot now -h}}
To keep the desktop and login window from opening in Ubuntu everytime it starts we want to mask out the few lines which start the service.
{{Code|Code = sudo vim /etc/init/gdm.conf}}
The first few lines of the script should look like this once you've edited it:
{{Code|Code = <pre>
# gdm - GNOME Display Manager
#
emits login-session-start
 }}</pre>
esc :wq to save the changes or :q! to start over. Now the desktop and login won't start in Ubuntu.
Reboot
{{Code|Code = sudo reboot now -h}}
B: We need to install VNC server to be able to interact with the gnome components for the desktop.
{{Code|Code = sudo apt-get install vnc4server}}
When prompted type Y and press Enter. This will install VNC Server which is required for running a virtual desktop on another machine.
Next type:
{{Code|Code = vncserver}}
You'll then be prompted to create and verify a new password.
So, type the following command to kill the session:
{{Code|Code = vncserver -kill :1}}
Now type the following command to open up the file we need to edit:
{{Code|Code = sudo vim .vnc/xstartup}}
Change it to look like this:
{{Code|Code = <pre>
#!/bin/sh
#x-terminal-emulator -geometry 1280x1024+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
}}</pre>
When you're done editing the file press the Esc key once and type :wq
Next type the following command to create the VNC Session once more:
{{Code|Code = vncserver -geometry 1680x1050}}
where 1280x1024 is the resolution of your DESKTOP COMPUTER.
So, from a Putty session:
{{Code|Code = cd /home/xxxx}}
where xxxx is your Ubuntu username. This command switches us into that directory.
Next we'll create a folder called MyScripts below your home folder. So type:
{{Code|Code = mkdir scripts}}
Switch into the folder we've just created type:
{{Code|Code = cd scripts}}
Next type:
{{Code|Code = vim StartVNC.sh}}
This will create a new file called StartVNC.sh and open it for editing.
Press the i key once and copy and paste the following contents:
{{Code|Code = <pre>
#!/bin/sh
echo "JOB RUN AT $(date)"
echo ""
/usr/bin/vncserver -geometry 1680x1050
</pre>
}}
NOTE: change the 1680x1050 to match the screen resolution of your Desktop computer
Next we need to make the file executable so, assuming you called your script StartVNC.sh then you'd type:
{{Code|Code = chmod a+x StartVNC.sh}}
Test the script by typing the following:
{{Code|Code = vncserver -kill :1}}
To make sure vncserver isn't running, then:
{{Code|Code = ./StartVNC.sh}}
A new vnc session should start.
Stop vncserver
{{Code|Code = vncserver -kill :1}}
Now open your browser and go to your HDA and click on the webmin app you already installed, click continue to this website at the cert warning.
Type or paste the name of your script including the full path
{{Code|Code = /home/xxxx/scripts/StartVNC.sh >/dev/null}}
into the Command box, replacing xxxx with your own usernam. The ">/dev/null" parameter will discard any output the script may produce.
Now let's check the script works on boot. So from the System -> Bootup and Shutdown menu within Webmin scroll down to the bottom of the screen and click the Reboot System button. Alternatively type
{{Code|Code = sudo reboot now -h}}
in a Putty/Terminal session.
Most of this information was obtained from: www.havetheknowhow.com.
 
= Alternate Method=
12,424

edits