[clue-tech] Virtual machine networking problem with samba

Michael Irons michael.irons at gmail.com
Tue Dec 1 21:18:55 MST 2009


On Tuesday 01 December 2009 12:33:30 am Shawn Perry wrote:
> NATed or Bridged networking?

FYI: Thanks to Jim, I solved my problem. It turns out I was blocking port 445 
with my firewall. I didn't realize that I needed it open.

But in case you are wondering: 

I am using Masquerading (NAT).

The default Ubuntu user space was to limited as it did not let me connect to 
my machines from outside.

Bridging worked fine, except, that there are very few places to connect to an 
ethernet connection in school (read none) and my wireless card does not 
support bridging.
By using masquerading and the script I wrote, I can choose the which interface 
I want to use for the VM when I start my VM

I set have a (pretty ugly) bash script that sets it all up for me and lets me 
choose my VM. Unfortunately it wasn't planned... it just grew...

Now that everything works, I will probably rewrite it. I still have to add in 
removing and adding the samba that Jim helped me figure out. It is in a test 
iptable config at the moment.

Here is the overview of what the script does do. I am pretty pleased... It 
does everything that I want... Every other solution left me wanting.

1) It creates the tap

2) Creates a vde_switch on the tap

3) It sets up the tap interface networking interface networking (i.e. gives it 
the ip 172.16.1.1) 

4) Asks which VM you want to boot (several XP versions, several linux distros, 
backtrack, etc)

5)  Asks if you want Internet connectivity or just "host to vm" connectivity 
(Some of the VMs aren't safe to run on the Internet). It also asks which 
interface I would like internet connectivity on if I choose Internet 
connectivity (currently eth0, or wlan0)

6) Sets up iptables Masquerading or/and or host to vm connectivity depending 
on answer to #5

7) Boots VM selected in #4 using vde as the nic to connect to the vde_switch, 
might do a few vm specific functions depending on vm selected

8) after VM closes cleans up tap, vde_switch and iptables

The only other thing I could add in is to use dnsmasq on my tap to give my VMs 
dynamic ips, but I don't have the need for it. I just set my VMs to a static 
IP. I played around with it and it worked well if anyone needs that solution. 
Takes 5 more minutes to set up.

Michael Irons


More information about the clue-tech mailing list