Ubuntu + Vagrant + VirtualBox + Ubuntu = Sleepless night

Because of some migration experiment, required by the project I’m working on, I’ve had interesting issue at last sleepless night with Ubuntu, Vagrant, VirtualBox and more Ubuntu.

My current host setup:

  • Ubuntu 16.04 LTS (up to date)
  • VirtualBox 5.0.24
  • Vagrant 1.8.4

The goal: migrate Vagrant + Puppet development setup from Debian 7 to Ubuntu 16.04. At least try to and get familiar with part of the issues.

Because I’m familiar with Debian and Ubuntu, and all Puppet provisioning scripts done mostly by me or my team members with my supervision – migration of Puppet provisioning went well (almost well, some small changes ant tweaks left, but nothing special).

Troubles appeared a bit later – when I’ve tried to setup project’s NPM requirements inside the box. After running npm install and after few first packages where installed “root” partition of new VM became read-only and installation process failed. That’s a strange issue – PHP dependencies, managed by Composer, went well and without any error or warning.

Installation process of NPM packages just stops and do not respond to any command. In TTY console I see: “Rejecting I/O to offline device“. In SSH console I see many errors like: “glob error { [Error: EIO: i/o error, scandir '/home/<username>/.npm/<packagename>/2.0.1/package']

Spend few hours by searching solution over internet and nothing helps:

  • Upgrading VirtualBox Guest Additions
  • Adding vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]
  • Adding vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
  • Adding vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant-root", "1"]
  • Running npm install --no-bin-links

By the way – sometimes this ends with kernel panic.

All that time I was using ubuntu/xenial64 box version 20160705.0.0.

One of the main reasons, described on the Internet was “symlinks don’t work on VirtualBox shared folders”. But this is not the case – I perfectly know shared folders issues and I don’t use them for project’s files sync between host and guest.

So, I’ve made clean Ubuntu Xenial install from ISO on fresh created virtual machine and everything went smoothly, from OS install to NPM – everything was installed!

Same good result was with PuppetLabs box puppetlabs/ubuntu-16.04-64-puppet.

This is how just a tiny issue with base box can keep you a bit sleepless. Yes, I know, that was my choice.

Now the question – should I build own box that I trust for this project or use something from third party Vagrant boxes available on Internet?

3 thoughts on “Ubuntu + Vagrant + VirtualBox + Ubuntu = Sleepless night

  1. Hello, I’ve encountered the same issue on Windows 10 VirtualBox 5.0.26 (Win8 working fine). And I’ve spent 2 nights on this =( The root cause seems to be VirtualBox emulation of ACPI. I’ve done the following things to make it disappear:
    – 1 processor in vm settings
    – i/o acpi disabled
    – change vm disk controller from scsi to sata
    It seems that puppet box you’ve chosen have similar settings instead of 2 processors + acpi + scsi.
    This links helped me:
    http://d.hatena.ne.jp/ytoku/20160506/1462552765 (Japanese)
    https://tickets.puppetlabs.com/browse/LEARNVM-270

  2. Thank you! But will build my own box, based on requirement from project and hosting. Self-made box works well :)

  3. I had the same problem using the ubuntu/xenial64 Vagrant box…

    On https://softwarefromnorth.blogspot.be/2016/08/ubuntu-xenial64-on-virtual-box-and.html, I found the following information:

    The ubuntu/xenial64 box is built wrong and horribly broken. Please note that “ubuntu” is the name of a user, not a representation of a canonical source for ubuntu images. Please try bento/ubuntu-16.04 instead. Thanks.

    (https://github.com/mitchellh/vagrant/issues/6616#issuecomment-227776489)

Leave a Reply

Your email address will not be published. Required fields are marked *

*