-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows host support #13
Comments
plan:
|
Since my opening comment I've learned two additional data points:
I think their may still be room for this plugin, and if it aligns with Vagrant's v3 golang migration plan, it will be ready for that key cross-platform, cross-arch use case. |
Please try 0.3.0 |
Thanks @ppggff I tested 0.3.1 and got further, qemu is running in background but it looks like
|
Thanks a lot. Please try 0.3.2, I replaced |
Yes my VM will boot in 0.3.2, it can set the hostname and ssh works, but with some caveats:
Some initial bugs remaining,
|
It's good news that it can boot. Please provide your Vagrantfile, I thinks I need to find a Windows machine to fix remained problems. |
Heres the snippet of config I'm using for this plugin: config.vm.provider "qemu" do |qe,override|
qe.arch = "x86_64"
qe.machine = "type=q35,accel=whpx"
qe.smp = "1"
qe.memory = "1G"
# default 'host' causes qemu-system-x86_64: unable to find CPU model 'host' on windows
qe.cpu = "qemu64" # max causes 'Unexpected VP exit code 4'
# qe.extra_qemu_args = %w(-bios c:/Users/admin/scoop/apps/qemu/current/share/edk2-x86_64-code.fd)
qe.net_device = "virtio-net-pci"
qe.qemu_dir = "c:\\Users\\admin\\scoop\\apps\\qemu\\current\\share"
qe.no_daemonize = true
qe.control_port = 33333
qe.debug_port = 33334
override.vm.synced_folder ".", "/vagrant", type: 'sshfs'
end Sorry I won't be able to share the complete Vagrantfile since its internal, I'll setup a generic example perhaps using the stock CentOS 7 box like in your example. You could possibly use Github Actions to test functionality on all platforms, although without acceleration. |
This project could fill a contentious gap for cross-platform development. On Windows, many devs are now using WSL2 as a Linux dev environment with all the advantages that are usually lost when developing in a Linux guest i.e. automatic file sharing, networking etc.
When you enable WSL2 on Windows 10, you must enable the hyper-v hypervisor, this is what the actual WSL2 VM runs on. But this causes complications and performance issues when using other hypervisors like VirtualBox and VMware. Using
vagrant-libvirt
inside WSL2 is possible on Windows 11 (and through live patching on Win10) but the created networks aren't available in Windows and port forwarding doesn't work.On Windows, its possible to install a msys2 compiled variant of QEMU from https://qemu.weilnetz.de/ which can use the 'whpx' accelerator on Windows, think KVM for Windows. Android devs would be familiar with this since that's what Android Studio uses to emulate and accelerate (x86 only) android devices.
But as of v0.1.9 of this plugin, it uses at least two features that the Windows version of QEMU doesn't support, namely:
-nodaemonize
argSo in combination with
vagrant-sshfs
for folder sync, this plugin could be a truly portable, non-root solution for vagrant on Mac, Windows and Linux.Another win for this approach, is the seamless cross-arch support that it implies i.e. arm-on-x86 and vice-versa
Please consider this a placeholder ticket for others who hit this issue, and as a possible launch point from where these issues can be resolved.
The text was updated successfully, but these errors were encountered: