Friday July 31, 2009 |
Using Cygwin to manage script Virtual Box tasksThe Virtual Box GUI doesn't do everything one needs and so I have been experimenting with using cygwin, a free to use bash shell library. Having installed CYGWIN the first thing to do is add the Virtual Box program folder to the PATH, in my case, export PATH=/cygdrive/c/Program\ Files/Sun/xVM\ VirtualBox:${PATH}
I want this placed in the .bashrc so its always invoked, and thus need to test if is already in the path. I use this code, type -p VBoxManage.exe > /dev/null
case $? in
0) # Its already there
: ;;
1) # Add Path
export PATH=/cygdrive/c/Program\ Files/Sun/xVM\ VirtualBox:${PATH} ;;
esacNow I need to associate a script file type with an execution program. I have tried to use the distributed batch file and binary and neiter of these work, so I have copied cygwin.bat to bash.bat and amended it so that it reads as follows @echo off
:: Dave Levy (c) 2009 Is this GPL?
:: bash.bat Version 1.0
:: Wrapper to run *sh scripts from windows explorer/desktop
c:\ksh\bin\bash --login %*I have deleted the -i flag from the bash line, I have made the bash program call absolute, %* is the DOS batch command file syntax equivilant to $* i.e. all the command line arguments, so the command line invokes bash.exe in login mode to force the execution of .bash_profile and .bashrc and appends all the other command line parameters including the script file name. :: is a neater comment delimiter than REM. I have associated my batch file with the file type .ksh as the open method using explorer. Much of CYGWIN is distributed under the GPL and I am unclear if the batch file is included, If so, its GPL since I created the file by copying it. keywords: howto invoke cygwin scripts from the windows desktop, write a dos batch file to invoke shell tags: technology virtualbox shell scripting cygwin windows (2009-07-31 06:58:27.0) Permalink And Google's AndroidIn case you havn't heard, Google have ported their mobile phone OS, android to x86, and made a live- cd version and so it can run inside Virtual Box. It looks like this.. Since the hardware to make calls isn't available the functionality's a bit limited tags: technology software virtualbox google android livecd x86 (2009-07-17 00:41:16.0) Permalink Comments [2] Another Virtual Box screenshot, this time Windows 7This is what Windows 7 beta looks like running inside a Virtual Box. I have downloaded objectdock and opened a sticky window. Its not very quick, but my first suspicion is that its a bit short of memory. That's the problem with using a 32 bit host. tags: technology software virtualbox windows7 screenshot (2009-07-17 00:22:27.0) Permalink And now I have a Centos VMThe reson for upgrading my Virtual BOx config is to install a Red Hat Centos image. I chose 4.7 because this seems jolly popular within the hosting community and I need a new host for my web servers. Two pieces of advice
Now I need a manual to help through all those little differences between it and Ubuntu. Is been a couple of years since I played with Red Hat's Linux. tags: technology virtualbox linux centos guest install (2009-07-02 10:52:15.0) Permalink Comments [1] Virtual Box 2.2.4 & Windows XPAnd with one might bound he was free.................. I downloaded Virtual Box 2.2.4 a couple of days ago, but when I tried to install it on my XP SP/3, the install process failed and rolled back. This trouble ticket, #3701 details how to fix the windows registry which was damaged at v2.2.0. Thanks to those who helped me find it. tags: technology virtualbox windows "xp sp3" windowsxp install(2009-07-02 09:51:32.0) Permalink How to set up a USB Flash Drive from Windows to Windows in Virtual BoxRead the User Manual, available on http://www.virtualbox.org/wiki/Downloads and think "all that stuff you need to know that's a bit poor". Then,
![]() This process was developed using a Windows Vista 32 bit guest and a Windows Vista 64 bit host, and a patched version of Virtual Vox 2.1.3 I have left the "All Devices" filter disabled. It will do all devices and thus some system devices will become visible to the guest such as the fingerprint reader, and whatever Chicony Electronics provide. Sasquatch is a regular correspondent at virtual box forums and offered his advice in a thread called "USB on Windows host and Windows guest". tags: technology virtualbox usb howto FAQ (2009-02-18 05:32:04.0) Permalink Do we need private community microblogging?Is twitter or microblogging a service that would benefit from more active community management? It would seem that the people at friendfeed seem to thinks so but the people at Laconica have produced a package that allows for the hosting of a microblogging community, which was pointed out to me by Peter Reiser and Scott Matoon. Despite Peter Reisers statement (on his twitter feed at 1.41 am GMT 3rd Feb) that it installs on Solaris like a dream, I chose to install on Ubuntu Linux and there is a specific install page for Ubuntu at the Laconica site. Its also useful to look at the >>README as it documents the pre-requisities and discusses the location of the site within the webserver's root namespace in more adult fashion than the Ubuntu install page. ![]() I have written up my install notes on my snipsnap, and must try and get them adopted at the Laconica site. I have also repeated them in the [Read More] section below, but once its properly installed I made a post, changed my avatar and checked the RSS, and I did it all in a Virtual Box image. tags: technology microblogging laconica community install ubuntu virtualbox [Read More](2009-02-04 02:16:48.0) Permalink Laptop Diaries, 64 bitness & VPNOver the last couple of days I have been struggling to get my new laptop build up to the minimal level of functionality I require, using Vista 64 as the host operating system. I calculated that I installed 19 applications on the previous minimal build, of which only Scmapp could be considered unnecessary. My colleague, Kar Yang Ho recommended Windows Vista 64 bit as the host and after some experimentation, we chose Virtual Box as the VM manager, primarily because its much cuter about how it takes and reserves disk space. We use CISCO's VPN solution to access certain services and have been struggling to get this to work from behind my Linksys Wireless-N ADSL2+ Gateway; the connection was failing. Firstly, we discovered on purchase, that one has to use a TCP carrier without NAT. I am seeking to install the VPN client inside a 32 bit virtual machine; CISCO don't have a Vista 64 implementation. Ho says that no one else with this router has the problems I had with it, although we have now fixed the connection by specifying the guest network interface as a “Host Interface” and not the default “NAT”. It seems that the Linksys only wants one NAT function in the configuration. I am pleased that we have fixed it, as I can now use Virtual Box to boot up Linux and Opensolaris images for experimental work and demonstrations. I also use them as X Server's for remote systems work and I have a Windows 32 bit image for that software that can only run in 32 bit windows such as the CISCO client. I installed the AMD64 version of Virtual Box on my Toshiba Tecra M10, with 4Gb of RAM on Vista Business SP1. tags: technology laptop vpn virtualbox windows vista vista64 [Read More](2009-01-27 02:58:41.0) Permalink Comments [4] +1 to virtual boxI installed a planet instance inside an Ubuntu Guest Virtual Box VM, and it failed the install tests. I was gratified to discover that a native instance of planet/ubuntu 8 failed in the same way. +1 to Virtual Box. Now onto fixing it. tags: technology planet virtualbox vbox (2009-01-08 06:26:03.0) Permalink Using Virtual Box's shared foldersI have taken advantage of Virtual Box's shared folder feature. I used the GUI to define one of the windows host folders as readable and then issue a mount command mkdir /public proving this works, I then insert a line into /etc/fstab, import /public vboxsf issue the mount -a command. There are no errors reported and tags: technology software virtualbox networking sharedfolders (2008-10-29 04:10:25.0) Permalink Virtual Box 2.0.4I have taken the opportunity to upgrade to Virtual Box 2.0.4. The upgrade for Ubuntu 8 goes fine, although EZ-Web is barfing on the upgrade; I have forgotten some password I need. (Hmm, I wonder if I should try the command line, or closing the postgres service first.) I have amended my proxy set up script. I had not read the documentation carefully enough and tried to set up the proxied ports while the VM was running. This is bad. The new script now displays the parameters set,
case $2 in
make) echo $0 make proxy
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/Protocol" TCP
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/GuestPort" ${port}
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/HostPort" ${port}
;;
show|list|display) echo $0 list parameters for $key
for property in Protocol GuestPort HostPort
do
./VBoxManage.exe getextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/${property}"
done
;;
rm|remove) echo $0 remove proxy
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/Protocol"
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/GuestPort"
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/${key}/HostPort"
;;
esac
I set the key variable earlier in the program. As you can see I have used two idioms now, i.e. iteration and sequence and I am sure a horrendous function could make the code much more economic. However it would have a non real name like act or do which is a clue to a design error. I wonder what it would look like in Python. Mind you, another reason this code is so repetitive is that the shell interpreter doesn't do associative arrays. Boo! The program now takes two arguments one to define the service and one to define the action. This is why the example above uses $2 as the case argument. The previous version of the code was published earlier this month here on this blog. tags: technology software virtualbox networking proxy (2008-10-29 04:01:10.0) Permalink Using a Virtual Box serviceI want to run a web service inside a Virtual Box container and consume it from initially the host OS, but later from other systems. This article describes how I accessed an apache served page from and Ubuntu 8 VM. Using Virtual Box 2.0.2, I read the manual version 2.0.2 chapter 6.4 which talks about allowing the host to utilise port services on a guest. I have a windows host, and a Ubuntu Linux guest. Despite the problems I have with the IT provided build, fortunately I have cygwin on the machine and so have an easy to use scripting language. Most importantly I have a rigourius 'cd' command with directory completion, my tcl and python shells are a lot fussier about the windows xp 16/32 bit name translation. So in the folder containing the program VBoxManage.exe, I create a script containing the following code, # need to force the shell, wonder how you do that
USAGE="$0 [make | [rm|remove] | help ]"
case $1 in
make) echo $0 make proxy
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/Protocol" TCP
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/GuestPort" 80
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/HostPort" 80
;;
rm|remove) echo $0 remove proxy
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/Protocol"
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/GuestPort"
./VBoxManage.exe setextradata "Ubuntu 8" \
"VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache2/HostPort"
;;
help) echo $USAGE ;;
esac
exit
I run the script with the argument 'make'. The token "Ubuntu 8" agrees with the VM name, and the token apache2 is afaik, anything I want so long as it agrees. Having run the script, I can boot Firefox in the host OS instance and see the guests default web page, using the URL What next, snipsnap? tags: technology software virtualbox networking guest proxy (2008-10-15 15:08:36.0) Permalink Comments [1] Sound and shares with Virtual BoxI have just upgraded from Virtual Box 1.64 to 2.0.2 and decided the time has come to turn the sound on and install shared folders. These are both simple configuration changes since the manual is simple, well written and correct. [ User Manual 2.0.2 ]. Just to remind you, I have a windows host and in this case an Ubuntu 8.0 Linux guest. In the settings panel for the VM, there is a sound tab, and there is a check box, which is defaulted to off. For a windows host, there is a choice of sound drivers. Since one of these is a null driver, its best to choose the other which is "Windows Direct" sound. There is a another tab for shared folders, with a file system browser. The purpose is to designate a host file system to act as the target for a guest mount and so act as one route to allow data to exit the VM. This is what I did,
I then unmounted the shared folder, edited /etc/fstab and issued a mount -a command to test that my syntax works. tags: Technology software virtualbox sound sharedfolder share (2008-10-14 03:15:17.0) Permalink Laptop Diaries, about video driversRecently I have written about problems I have had with pidgin xmpp chat rooms, however, I have also come across a problem where I can't switch between the Firefox 3 control panel and rendered page, so I looked to see if anyone else had a similar problem. I found this article, called Can't Click Inside Firefox 3 Window Without Losing Focus 1st at http://forums.mozillazine.org/, where yesterday, someone posted that new nvidia drivers had helped him solve the problem. So a quick visit to Toshiba UK's support portal and I discover that the most recent driver is over 6 months old, so I grab that an install it. I suppose its one of the problems in taking someone else's build. I now obviously need to wait and see if the problem re-occurs but so far so good. Given I have new display driver, I have decided to re-install Pidgin 2.5.1 and its associated GTK library. This also seems to be working OK and I have not yet had a problem with the XMPP rooms. I also documented the problems here..., on my Bliki. I am running a Toshiba Tecra M5 with Windows XP as the OS. I have Sun xVM Virtual Box to let me run Open Solaris and Ubuntu Linux. I take the windows build from our IT department. tags: Technology im messaging pidgin virtualbox software windows xmpp toshiba laptop "video driver" (2008-10-10 03:28:36.0) Permalink More about Pidgin and XMPPI've spent the day struggling with Pidgin, XMPP and Google Talk. I am still using Pidgin V2.0.1 on Windows XP, with GTK+ 2.10.11. Today I tested Pidgin 2.5.1 and GTK+ 2.10.11 and discovered that I couldn't get it to work with Google Talk. I also discovered that the reliability of XMPP service was dreadful, although I discovered later that this may have been a server issue. I'll have to try again later in the week. I have documented the state of my findings at Pidgin and Google Talk, at my bliki. tags: technology software IM messaging windows xmpp pidgin "google talk" (2008-09-23 09:50:37.0) Permalink Comments [2] |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||