[clue-tech] Virtual machine networking problem with samba
Michael Irons
michael at beckonsmeby.com
Sun Nov 29 19:22:24 MST 2009
Hello all,
I have a host laptop which acts as a host to virtual machines and a samba
server. The main purpose of setting up the samba server was to transfer
files from the XP vm guest to the host which is my main workstation. The
problem is that the XP guest can only find the samba server intermittently.
Don't hesitate to correct my networking skills... It is definitely my weak
point in all of this.
I know the samba server is set up correctly on my laptop "Babbage", as
other machines can connect to the samba server just fine. My virtual machine
network works flawlessly as I can ping everything from everywhere. I think
my problem lies in my guest VM's local network name resolution. My guests
don't know where host Babbage is located. The odd part is that I can
intermittently connect to the samba server from the guest xp vm by mapping a
network drive. when it works, it works fine. when it does not work, I get
this message:
"The network path to Babbage\share could not be found."
I have tried adding Babbage's ip address to the XP vm's host file for a
quick fix, but to no avail.
Can anyone steer me in the right direction? I am googled out.
I have a non standard VM setup. I need more then the standard userspace
ubuntu setup provides (I have to reach the VMs from the outside), and my
wireless card does not support bridging, so a bridge was not a option. I
often require my vm's to have network connectivity without a wired
connection.
I have scripts that normally execute this setup... I just pulled out the
relevant parts to simplify it for the problem at hand:
Create a tap0:
sudo tunctl -t tap0
Create a vde switch
sudo vde_switch -d --numports 4 --hub --mod 666 --group users --tap tap0
Configure tap
sudo ifconfig tap0 172.16.1.1 netmask 255.255.255.0
Configure masquerading to allow internet access to vm.
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i tap0 -j ACCEPT
sudo iptables -A INPUT -s 172.16.1.1 -d 127.0.0.1 -j ACCEPT (not sure I
need, just added for assurance when samba wasn't working)
sudo iptables -A OUTPUT -s 127.0.0.1 -d 172.16.1.1 -j ACCEPT (not sure I
need, just added for assurance when samba wasn't working)
Start vm ($MAC is a random mac address generated by a script).
vdeq kvm -vga std -usb -hda /vms/xp.img -net nic,macaddr=$MAC -net vde -m
2048
Setting the XP pro guest settings:
Static IP: 172.16.1.2
Default gateway: 172.16.1.1 (same as tap0)
DNS Servers: OpenDNS servers
All of this works. From the VM I can: Ping the host, the tap, the internet,
connect to the internet. From the host, I can ping the guest, the tap, and
all other normal functions work. Samba is my only problem
Thanks,
Michael Irons
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://cluedenver.org/pipermail/clue-tech/attachments/20091129/d4d420f4/attachment-0001.html
More information about the clue-tech
mailing list