Thursday Jul 30, 2009

Using Cygwin to manage script Virtual Box tasks

The 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} ;;
    esac

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

Thursday Jul 02, 2009

Virtual Box 2.2.4 & Windows XP

And 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: ""

Monday Jan 26, 2009

Laptop Diaries, 64 bitness & VPN

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

[Read More]

Thursday Oct 09, 2008

Laptop Diaries, about video drivers

Recently 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: ""

Tuesday Sep 23, 2008

More about Pidgin and XMPP

I'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: ""

Thursday Sep 11, 2008

Chatting

I was introduced to IM by my US colleagues (& my children). Many of the former use AOL to forward IM's to their phones. This has become even easier to use with the advent of the iphone. Sun has also implememented an XMPP service and I came to the IM scene with a couple of YIM contacts as well. So I adopted GAIM and went with the pidgin people when that came along so I only have to worry about the protocol I use for those colleague like me with multiple service accounts.

I have recently had a real problem with pidgin in XMPP chat rooms, and when my boss decided to open a permanent chat room, these problems had to be fixed. Basically, I have reverted to Pidgin 2.0.1 for Windows. I did experiment with using pidgin inside an Ubuntu Virtual box instance and it worked fine, an interesting use case for Virual Box. I propose to raise a bug/note at pidgin's site, but you can use the [READ MORE] button below to read my more detailed notes, which cover the failure symptoms, Google Talk and more about facebook.

tags:

[Read More]

Thursday Aug 21, 2008

Laptop Diaries, don't do this.

I feel a complete and absolute fool about this one. Longtime readers will know that I have from time to time mucked around with the operating system I use on my laptop, from single to dual boot, experimenting with various Windows, Solaris and Linux iterations. At home I have a couple of desktops running windows, (XP at the moment), primarily because they come with it, but it also runs games, and supports the UK education system's curriculum. I have been experimenting with Virtual Box; at home, mainly to give me x-windows access to my Qube. On my work's laptop, I have vm's running Indiana, Nevada and Ubuntu 7 & 8. I plan to do some pretty exciting things with it when I can find the time. At home, I installed an Ubuntu 8 VM, but i have a very important piece of advice for people using Windows as a host operating system, which I discovered on one of my desktops.

Don't use FAT or FAT32 file systems.

I made a mistake, I can't remember how, but my new HDD has a FAT32 file systems. This has a 4Gb file size limit, so while the virtual box manager will let you define the max file size as whatever you want, when the VM tries to extend beyond the 4Gb limit, the VM reports a disk full error. Fortunately I don't have very much on this disk yet, so the repair is fairly painless.

I documented this here at the virtual box forum, unfortunately the title's not so useful. As I said, I have been working with UNIX too long, I'd forgotten what 32 bits means.

tags:

Wednesday Aug 13, 2008

Laptop Diaries, more Bluetooth

Over the last few weeks I have struggled to create a bluetooth 3G modem on my new Tecra M5. The Bluetooth drivers on this XP build have been provided by Toshiba and the big difference between it and my previous configuration which uses the Microsoft stack is that the special phone number code that the microsoft drivers require is not required when using the Toshiba drivers. It has a specific field for holding the modem configuration parameters and uses the default phone number of \*99#. I should have waited.

You can also ignore the create the modem stage.

tags: should be 'how not to'

Friday Jun 20, 2008

An motd in tcl for Windows XP

I bought an external disk from Amazon for my main home machine, which runs windows and have been moving various user's 'My Documents' folders onto the disk. It has a seperate power supply and switch so its quite easy to start the computer and forget the disk, so I have written a program to check and remind people. I have written it in tcl/tk, my main documentation is on my snipsnap, but its a jolly short program, quick to write and easy to install. Use [Read More] below to check out the code and/or download it.

tags:

[Read More]

Thursday Jun 05, 2008

Laptop Diaries, onto the internet with 3G

I have just moved my laptop forward to an improved build. This proves that this article only works if the bluetooth drivers are the microsoft drivers on XP. I have modified the tags on this article. In fact, this was meant to be a follow me article, I hope it works for you. I have written about the toshiba drivers at Laptop Diaries, more bluetooth on this blog.

My colleague at work Sean Harris, helped me configure my laptop and phone to use the phone's 3G capability to connect the internet. Sean was guided himself by this article at 'crackistan'. While that author writes about Mac OS, and I am using Windows XP, we both use sony erricson phones and vodafone as our service provider.

I really did this for times where I have no internet access, but as 'Bodoggy' points out, it may come in useful in airport lounges or other places where the wi-fi costs are outrageous, or their credit cards systems broken.

So the process is

  1. Create a connection channel between the phone and laptop, and I used blutooth
  2. Create a dial up agent for vodafone and select your new modem

The only tricky bit is that you don't use a phone number to connect to the internet, there is a special code instead.

To find out in more detail what I did, use the [Read More] button below. 

tags:

[Read More]

Saturday Jun 16, 2007

Running Python on Windows XP

Learning PythonI got myself a copy of the O'Reilley "Learning Python" book and started working myway through it. For various reasons, I decided to try it on Windows; I thought the binary install would be easier and I am in the process of upgrading the Solaris version and I wanted to finish that first. The windows install from python.org is quite cute, as you would expect but it requires some further configuration before the python imports and module search works properly.

Firstly my "My Documents" is on a different disk to the Program Files directory. The Python interpreter is installed by default into the C:\\Program Files directory. This means that Python is not in the %PATH% string and that the icon for the Python CLI starts a Python instance that can't see/find my programs. My first instinct was to write a script that invokes the interpreter from the python scripts directory and I came across this link.

This pointed me to the windows help center's A-Z command reference. (Obvious, but so easy not to know about; its available from the [Start] button or using F1 while the desktop is current).

I wrote the following mighty script, called run_python.

C:\\PROGRA~1\\PYTHON2.5\\python %1

which is located in my python modules directory/folder. This can be run from the command line or explorer to start the interpreter or takes a single file argument from a command line to run a python module. This still isn't what we want, so I found

which pointed out that the PATH variable can be edited using

My Computer - Properties - Advanced - Environment Variables

so this is what I did, which means that is when I [Start] [Run] [command], and then type 'python', the command interpreter starts. This means I can use the command line to run programs, or I can iconise the modules, or create batch files containing the python module invocation. I think my super script above will become redundant, but it proves to me that scripting will never go away and I am gratefull for the help of the two web sites above, which I though I'd share with you.

tags:

Tuesday Feb 28, 2006

Tuesday Highlights

Bill Vass Sun's CIO presented to us today. I last heard him speak last February. He offered three useful insights.

  1. Sun IT runs a Sun-on-Sun reference program. I need to check out their "Secure Mail" offering and the resource management solution as we have implemented soft containers throughout the estate.
  2. Sun ran a Solaris 8 to 9 adoption programme. This took 3 months and the speed was enabled by de-mirroring swap and haveing tow versions of the OS on each system. They booted on S9 with minimal pre-testing and reverted if there were any problems. There weren't depsite the move to active resource management. I asked if he was frightened of failing to adequatley test the mythical "end of year" program. He said not, they JFDY'd it.
  3. He spoke about "encouraging" us to move towards personal compliance to their standards. One inducement is that they propose to implement wine as part of the JDS build, for those final stubborn windows apps. Hopefully, he'll find ways of enabling us all to benefit from their build standards.

tags: ""

About

DaveLevy

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today