Thursday Jul 02, 2009

And now I have a Centos VM

The 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

  1. Download the x86 DVD image, I couldn't see how to use the multiple disk images with Virtual Box.
  2. It installs an SMP and uniprocessor version and grub is configured to start the SMP version as default. This thread, entitled CentOS 4.7 guest won't start, suggests that one should configure PAE/NX=on for the SMP image. This is not the default. Anyway works for me.

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:

Wednesday Oct 15, 2008

Using a Virtual Box service

I 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 http://127.0.0.1. Oddly, http://localhost is resolved as something else, but I expect its the apache configuration file that does this.

What next, snipsnap?

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