How to disable hard disk

Hi,

How do you disable the hard disk creation for a Vagrant VM?

I could not find any option to disable it.

I am setting up a multi vm environment thin client setup where the second vm boots from the network and gets its image over the network. This all works fine! But when doing the vagrant up the command it unnecessarily creates a hard disk. And I need to also define a basebox which gets initialized.

Thank you in advance,

Rudy

Heya Rudy,
Vagrant just recently added support for managing disks. This is an experimental feature, so is turned off by default. However, sometimes vagrant boxes will have disks associated with them. Would you be able to share your Vagrantfile so I may understand the issue a little better?

Thanks,
sophia

Hi Sophia, yes here it is:

Vagrant.configure("2") do |config|

  config.vm.box = "chenhan/ubuntu-mate-desktop-20.04"

  config.hostmanager.enabled = true
  config.hostmanager.manage_host = true
  config.hostmanager.manage_guest = true
  config.hostmanager.ignore_private_ip = false
  config.hostmanager.include_offline = true

  config.vm.box_check_update = false


  config.vm.define "ltspserver" do |ltspserver|
    ltspserver.vm.hostname = 'ltspserver'
    ltspserver.vm.network :private_network, ip: "192.168.67.2",
      virtualbox__intnet: "ltsp"
    ltspserver.vm.provider "virtualbox" do |vb|
      vb.memory = "2048"
      vb.cpus  = 4
    end

    config.vm.provision "ansible" do |ansible|
      ansible.playbook = "ltsp.yml"
      ansible.become = true
      ansible.groups = {
        "servers" => ["ltspserver"],
      }
    end
  end

  config.vm.define "fatclient" do |fatclient|
    fatclient.ssh.insert_key = false

    fatclient.vm.box = "minimal/trusty64"
    fatclient.vm.hostname = 'fatclient'
    fatclient.vm.network :private_network, type: "dhcp",
      virtualbox__intnet: "ltsp", adapter: 1
    fatclient.vm.provider "virtualbox" do |vb|
      vb.gui = true
      vb.memory = "1024"
      vb.cpus  = 2
      vb.customize [
        'modifyvm', :id,
        '--boot1', 'net',
        '--boot2', 'none',
        '--boot3', 'none',
        '--boot4', 'none'
      ]
      vb.customize ["modifyvm", :id, "--vram", 32]
    end
  end
end

Indeed, using a vagrantbox without a hard disk is the idea. (Which seems a contraction!)
I want to remove the harddisk from ‘fatclient’.

Heya Rudy,
so inspecting the virtual box .ovf in the minimal/trusty64 box reveals that it has a disk that it attaches. You might want to package your own box that doesn’t have a hard disk in this case. The process should be pretty straight forward if done manually, or using packer.