Most popular tags

Welcome to Earthwithsun.com, where you can ask questions and receive answers from other members of the community.

Linux Virtual Machine runs Slow depending on the Network

At work I use a VM running Linux Mint 13 under Oracle VM VirtualBox 4.2.16 on a Windows7 machine. The laptop is connected to a network cable and the wireless connection is turned off. The network setup for the VM is to use a Bridged Adapter to the Gigabit Network Connection with its own MAC Address. This allows me to run Samba on the Linux system so I can share files between the two operating systems. Everything works fine.

The problem happens when I take the laptop home. At home I use the wireless connection. The Windows side has no internet connectivity problems. The VM, on the other hand, runs really slow. Bringing up a xterm window and completing an 'ls' command might take 15 seconds. I've tried bringing up the VM with different adapter settings in VirtualBox and even with all Network Adapters disabled, but I see the same behavior every time.

When I'm patient enough (and an adapter is connected), I can see that the VM is getting an IP Address but it's unable to ping anything in the outside world. What could be happening here?

To further confuse things, I have a second VM running the same version of Linux Mint. Same VM hardware setup, it just doesn't have Samba running or any of my work. :) Anyway, it connects to the internet and runs just fine.

What could be different between the two that could cause one Linux VM to be so slow that it's unusable? I've tried stopping Samba, but that doesn't seem to change anything. What else could I try?

Update

Results of experiments tonight (Note: By "Xterm operations" I mean simple things like typing 'ls' in an Xterm window and navigating a directory structure):

  1. Tried running with no network connections enabled at all on the laptop (Windows or VM). Xterm operations were still slow.
  2. Enabled wireless network connection to the laptop. Enabled network connection to the VM, but did not attach it. Xterm operations were slow.
  3. Enabled NAT connection to the VM. The VM obtained a strange IP Address (10.0.3.15) and Xterm operations were still slow.
  4. Enabled bridged connection. Obtained correct IP Address (172.16.42.7, Windows was 172.16.42.4 and both had 255.255.255.0 for the mask), but Xterm operations were slow. Was able to ping 172.16.42.1 from the VM and ping the VM from Windows.

I should mention that I'm connecting to the Guest Network on my Apple Time Capsule.

At this point, I double checked the hardware configuration between my two VMs - the working one and the non-working one. I noticed 3D acceleration was enabled for the non-working one. When I disabled 3D acceleration, the Cinnamon windows manager displayed numerous graphical glitches, but Xterm operations were normal speed. I disabled 3D acceleration and rebooted into the software rendered version of Cinnamon.

The graphical glitches were gone and Xterm operations were normal speed. Unfortunately I could not connect externally. By that I mean I could ping 172.16.42.1, but not www.google.com. I would be okay switching to MATE, but that's difficult right now without an external connection.

Why would the window manager and/or 3D acceleration affect operations in an Xterm window when I'm running on a different network? Or could this be related to a different factor like the power supply? Something magical about my kitchen table?

Update 2

I switched Linux Mint 13 from running Cinnamon to running MATE and that solved the slowness problem!

Unfortunately I'm not out of the woods yet. This is probably a separate problem, but I can't connect to the outside world. The Linux Mint VM running MATE starts up and obtains an IP Address. I can ping the system from Windows. I can even mount the Linux Mint Samba share from Windows and browse the directories.

From the Linux Mint VM perspective, I can't ping the Windows host, but I can ssh into a Raspberry Pi on my network. So connectivity inside the network appears to work fine. I just can't ping Google from the Linux Mint VM. I even tried connecting via my wired network, but no luck there. I should probably write up a new question, but I wanted to at least post an update here on my latest status.

1 Answer

It could very easily be that the wrong thing is getting set in /etc/resolv.conf. Either the contents point to the wrong DNS server (non-existant, broken, or behind a firewall (the one at work) or your network is not providing you access to the network where the listed nameserver resides (e.g., the internet, or your local router/gateway device.

When the VM is acting slow, as root, edit /etc/resolv.conf and comment out everything in it.

See if operations become normal speed again. If they do, then access to DNS is what is slowing you down.

Then ping 8.8.8.8. If it works, edit /etc/resolv.conf and put this as the first line:

nameserver 8.8.8.8

Looks like something is loused-up within the VM, but I don't think it is possible for us here to find out what's wrong for you over there. Only you can do that, because only you can experiment.

In the case that the problem is with the VM's definition, you could try to delete the VM while keeping the .vdi file, create a new virtual machine (with attention to the 32/64-bits host/guest question), and attach the .vdi disk.

If this doesn't help, then the problem is inside the VM within Linux Mint internals and can be anything at all.

If nobody comes up with any better idea, I would then suggest junking this VM and starting afresh, maybe taking the VM that works as a starting point.