[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Laptops and Virtulization



On Friday 19 September 2008 09:56:11 Clifford W. Hansen wrote:
> On Friday 19 September 2008 09:38:04 Stephan Peijnik wrote:
> > On Fri, 2008-09-19 at 08:59 +0200, Clifford W. Hansen wrote:
> > > I would like to find out from the list what they use on there laptops
> > > for virtulization.
> > >
> > > I'm needing to run a vm on my laptop for using as a development server,
> > > and I need it to be able to access the network my wifi card is attached
> > > to.
> > >
> > > I have scoured the interweb and havn't found what I'm looking for
> > > (other then vmware which has some issues)
> > >
> > > I would prefer to run the latest etch-n-half kernel, possibly even
> > > lenny although I don't have lenny yet.
> >
> > Personally I am using VirtualBox OSE for exact the reason you would like
> > virtualization.
> >
> > After a quick check virtualbox-ose is either available within Lenny
> > (including the kernel module) or via etch-backports where you need to
> > build the kernel module yourself though.
> >
> > For a list of packages available in Debian check
> > http://packages.debian.org/search?keywords=virtualbox-ose.
> >
> > Regards,
> >
> > Stephan
>
> Stephan,
>
> I was using VirtualBox for a while, but could never get the bridged mode
> working due to my laptop connecting via wifi, but then again no one else
> needs to access my dev box anymore. Well DHCP wasn't working.
>
> Will give it a bash again, thank you...

Just for future reference / anyone who is interested I got the following 
working.

And it almost does exactly what I need, well it's good enough for now:
<vbox-networking.sh>
#!/bin/bash

LAN="eth1"
DHCP_SERVER="xxx.xxx.xxx.xxx"

case "${1}" in
        "start" )
                TAP=$(VBoxTunctl -b -u clifford)
                echo ${TAP} > /var/run/vbox.tap
                sysctl net.ipv4.ip_forward=1 >> /dev/null
                ip link set ${TAP} up
                ip addr add xxx.xxx.xxx.xxx/xx dev ${TAP}
                parprouted ${LAN} ${TAP}
                iptables -t nat -A POSTROUTING -o ${LAN} -j MASQUERADE
                dhcrelay3 -q -i ${LAN} -i ${TAP} ${DHCP_SERVER}
                echo ${TAP}
                ;;
        "stop" )
                TAP=${3}
                kill -9 $(ps -elf | grep ${TAP} | grep -v grep | awk '{print 
$4}' | grep -v $$)
                ifconfig ${TAP} down
                VBoxTunctl -d ${TAP} >> /dev/null
                sysctl net.ipv4.ip_forward=0 >> /dev/null
                ;;
esac
</vbox-networking.sh>

This can then be used by VirtualBox as the network script (Network --> Host 
interface settings --> Setup/Terminate)

I just run these as "sudo /path/to/vbox-networking.sh start" and it does the 
rest.

Unfortunately due to using parprouted it seems like it's not accessable from 
the lan, but I'm working on this... The solutions possibly has something to 
do with a bridge...
-- 
Thank you,

Clifford W. Hansen
PHP Developer / Linux Administrator

(Cell)    +27 82 883 8677
(Fax)     +27 86 503 0634
(E-Mail)  clifford@nighthawk.co.za
(MSN)     clifford@nighthawk.co.za
(GPG)     0x936D6C19

"We have seen strange things today!"

()  ascii ribbon campaign - against html e-mail 
/\  www.asciiribbon.org   - against proprietary attachments

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: