Mount a CDROM with ISO in VirtualBox and Win Server 2012 R2

356 views
Skip to first unread message

Rob Allen

unread,
Mar 5, 2017, 12:00:01 PM3/5/17
to Vagrant
Hi All,

I am trying to add a CDROM and Insert the ISO installer for the Add-WindowsFeature to install domain services.

My domain controller looks like this.

config.vm.define "DomainController1" do |dc01|
    #dc01.vm.box = "jptoto/Windows2012R2"
    dc01.vm.hostname = "DC01"
    dc01.vm.box = "mwrock/Windows2012R2"
    dc01.vm.communicator = "winrm"
    dc01.winrm.username = "vagrant"
    dc01.winrm.password = "vagrant"
    dc01.vm.network "private_network", ip: "192.168.10.2"
    dc01.vm.provision "shell", path: "ps1/Setup-CommonTools.ps1"
    dc01.vm.provision "shell", path: "ps1/Install-DC.ps1"
    dc01.vm.provision "shell", path: "ps1/Setup-DC.ps1"
    dc01.vm.provider "VirtualBox" do |vb|
      vb.memory = 2048
      vb.cpus = 2
      #vb.customize ["modifyvm", :id, "--boot1", "disk", "--boot2", "dvd"]
      vb.storage :file, :device => :cdrom, :bus => :ide, :type => :raw, :path => "C:\\vm\\Server2kR2.ISO"
   
    end
  end

However, this does not give me another drive with the inserted CD. I have read a bunch of stuff on this topic , but it just left me confused. Has anyone a simple method of doing this ?

I am on Windows 10 using VirtualBox.

regards,
Rob

Alvaro Miranda Aguilera

unread,
Mar 6, 2017, 2:23:04 AM3/6/17
to vagra...@googlegroups.com
Hello.

If the line to mount an iso is like this:

VBoxManage.exe storageattach "<uuid|vmname>" --storagectl IDE --port 0 --device 1 --type dvddrive --medium "X:\Folder\containing\the.iso"

Then the Vagrantfile will look like this:

    dc01.vm.provider "VirtualBox" do |vb|
      vb.memory = 2048
      vb.cpus = 2
      vb.customize ["storageattach ", :id, "--storagectl ", "IDE", "--port", "0", "--device", "1", "--type", "dvddrive", "--medium", "C:\\vm\\Server2kR2.ISO"]
    end

You can test manually first, you may need to give the full path of VBoxManage, and depending on if the disk is ide, then port 0 device 0 is used you can try port 1 device 0 or port 0 device 1
this is the same like old ide ports 0/1 with master/slave setup.


Thanks
Alvaro.




Virusvrij. www.avast.com

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/aff96f32-c1b2-4f58-be32-b93eb3e48972%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

Reply all
Reply to author
Forward
0 new messages