mitchellh / boot2docker-vagrant-box

Packer scripts to build a Vagrant-compatible boot2docker box.
424 stars 183 forks source link

Insufficient graphic memory for boot2docker Vbox VM when using docker provider with force_host_vm #81

Open olberger opened 9 years ago

olberger commented 9 years ago

Here's a repost of https://github.com/mitchellh/vagrant/issues/5287 :

I'm testing the docker provider using force_host_vm = true to instantiate a VirtualBox boot2docker VM on Linux (trying to test what would happen when on Windows). It seems that the VM is created using only 8 Mb of graphic memory, which VirtualBox reports as insufficient for displaying the graphic console (tells that 9 Mb is the minimum), Hence, the VirtualBox gui = true won't apply and the VM stays headless, which doesn't help when vagrant ssh won't work, which renders it complex to login to the VM for debugging.

I'd suggest to change the defaults so that 9 Mb are used.

AFAIU, it is possible to workaround this by using a custom Vagrantfile for boot2docker, like:

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.define "app" do |app|
    app.vm.provider "docker" do |d|
      d.force_host_vm = true
      d.build_dir = "."
      d.vagrant_vagrantfile = 'Vagrantfile_hostVM'
    end
  end

where Vagrantfile_hostVM contains:

 Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|

  config.vm.box = "mitchellh/boot2docker"

  config.vm.provider "virtualbox" do |vb|
    vb.gui = true

    vb.customize ["modifyvm", :id, "--vram", "36"]
  end
...