Click here to Skip to main content
Click here to Skip to main content

Lubuntu or Ubuntu fails to update on VirtualBox virtual machine

, 12 Oct 2012
Rate this:
Please Sign up or sign in to vote.
When a Lubuntu or Ubuntu is installed in a VirtualBox, by default the networking mode is selected NAT.

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 http://archive.ubuntu.com/ubuntu/pool/main/libe/liberror-perl/liberror-perl_0.17-1_all.deb Size mismatch
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/git/git-man_1.7.5.4-1_all.deb Bad header line [IP: 91.189.92.181 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/git/git_1.7.5.4-1_i386.deb Bad header line [IP: 91.189.92.181 80]
Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/p/patch/patch_2.6.1-2_i386.deb Bad header line [IP: 91.189.92.181 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 protocols (i.e., NFS) and that leads to 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.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

RizviHasan
Software Developer
Sweden Sweden
No Biography provided

Comments and Discussions

 
-- There are no messages in this forum --
| Advertise | Privacy | Mobile
Web03 | 2.8.140827.1 | Last Updated 12 Oct 2012
Article Copyright 2012 by RizviHasan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid