adrahon / vagrant-kvm

This project is dead, please use vagrant-libvirt instead! A Vagrant 1.4+ plugin that adds a KVM provider to Vagrant, allowing Vagrant to control and provision KVM/QEMU VM.
MIT License
365 stars 60 forks source link

windows: synced folders? #261

Closed jakobadam closed 10 years ago

jakobadam commented 10 years ago

Just a heads up on Windows support especially synced folders on windows. What sync methods are supposed to work and which aren't?

Options: nfs - can't mount share in windows p9 - tried as default, but fails. Would it work if something is installed in Windows? rsync - works, but sub-optimal due to manual sync.

I ended up sharing the source code manually via Samba from the Ubuntu 14.04 host. Do you know why Vagrant only supports Samba when the host is Windows? I see no reason why this is not incorporated in Vagrant.

Relevant part of the Vagrantconfig:

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

  config.vm.define :windows do |c|
    # hostname doesn't work
    c.vm.hostname = "test"

    c.vm.box_url = "file:///srv/boxes/windows-2012R2.box"
    c.vm.box = "windows-2012R2"
    c.vm.guest = :windows

    # Can't connect to nfs share from windows
    # c.vm.synced_folder ".", "S:", :nfs => true, id: "vagrant-root"

    # Works, but sub-optimal due to manual sync
    # c.vm.synced_folder ".", "/cygdrive/c/vagrant", type: "rsync", rsync__exclude: [".hg/", "software"]

    # Would prefer this, but is not supported
    # c.vm.synced_folder ".", "/vagrant", :type => "smb"

    # Forward rdp
    c.vm.network :forwarded_port, guest: 3389, host: 3389
  end
end

The windows box is created with Packer. Template available here and some info about creating it slipstreaming-vm-imags-with-packer

kind regards, Jakob

adrahon commented 10 years ago

I don't use Windows host so I just overlooked the use case. P9 should work with a driver on the Windows guest, maybe that's something to explore. I don't know how you would configure it.

Samba should also be implementable, I have no idea why it's not standard in Vagrant for Linux hosts. Another option will soon be MTP (USB media transfer protocol) which as just been added to libvirt and should work with any guest.

Any suggestion on what would be the best solution?

jakobadam commented 10 years ago

Thanks for the answer.

I've asked regarding samba in the vagrant repo: https://github.com/mitchellh/vagrant/issues/4644