Lubuntu or Ubuntu fails to update on VirtualBox virtual mechine

Some times I feel that I have reached the end point of my patients just like this day when I was stuck in Lubuntu update.  I have set up the Lubuntu in VirtualBox virtual machine. Right after the installation i tried to update it – it failed to update then I tried to install GNOME-Commander that also failed.

The error was like this:

 Failed to fetch Size mismatch
 Failed to fetch Bad header line [IP: 80]
 Failed to fetch Bad header line [IP: 80]
 Failed to fetch Bad header line [IP: 80]
 E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

It seemed that it could not connect to the server very well.  But when I check the internet connection it works fine in all browsers. I searched about this topics in the google but could not find any way to fix it, not even in Ubuntu Forum. I was super confused and didn’t ever thought that it could be an issue from VirtualBox – coz all the browsers were working fine.  Fortunately the next day a post from Nicolas saved me out.

The network  connection for a VirtualBox uses optionally 8 hardware settings and 6 networking modes. Check out here for details. Among the 8 hardware most commonly used hardware is AMD PCNet FAST III (Am79C973, the default) – no problem with that. But the among the 6 networking modes the following 3 are mostly used.

  • Not attached mode (the guest OS consider that the network cable is unplugged)
  • Network Address Translation (NAT) mode (uses NAT between guest and host OS – therefore has some limitation)
  • Bridged networking mode (VirtualBox connects to one of your installed network cards and exchanges network packets directly)

When a Lubuntu or Ubuntu is installed in a VirtualBox, by default the networking mode is selected NAT which is OK for browsing but has certain limitations with some protocol(ie. NFS) and that leads our problem – the Update manager can not communicate with the servers properly.

So to fix this issue just change the mode from NAT to Bridged networking mode. To do this in VirtualBox go to Settings -> Network, under the first tab change the ‘Attached to’ drop-down from ‘NAT’ to ‘Bridged Adapter’.

Hope this post will save a day of yours.


4 thoughts on “Lubuntu or Ubuntu fails to update on VirtualBox virtual mechine

  1. TIP: Sometime it happens in your Lubuntu Virtual PC that it fails to connect to internet. The quick fix is to check whether you can connect to the default gateway(ping ). If it can not connect do as following.

    Go to VirtualBox’s Setting -> Network. Expand the Advanced option, refresh the MAC Address. Reboot the system. Now it should connect internet.

  2. This is really interesting, You’re a very skilled blogger. I’ve joined your rss feed and look forward to seeking more of your wonderful post.
    Also, I’ve shared your web site in my social networks!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s