gusztavvargadr / packer

Packer templates for building Windows and Ubuntu images
https://app.vagrantup.com/gusztavvargadr
The Unlicense
457 stars 67 forks source link

Add VMware provider support #168

Closed aescolastico closed 9 months ago

aescolastico commented 4 years ago

More of a feature request. Would you be willing to add this to box? I know a lot us would appreciate it. You've built a very good image here. Kudos!

gusztavvargadr commented 4 years ago

@aescolastico thank you for raising the issue. I'm glad to add more features if it adds value like this, thank you for the feedback, this helps a lot with shaping the directions :)

Please let me know what box(es) you prefer to have with VMWare the most, I can start experimenting with them. If that is successful, I can of course add that provider to all the boxes.

gusztavvargadr commented 4 years ago

@aescolastico also, please let me know what is your basic scenario, like which host OS and which VMware product you use at the moment, and do you have any box with VMware that you use at the moment.

I am less experienced with VMware, but the above could help :)

If you have any feedback on the actual image contents (what makes it good as you say, what else you would like to see, like more contents, more often releases, etc), please let me know :)

aescolastico commented 4 years ago

Of course yes. The box of yours that fits my needs is the Windows Server 2019 Standard Core, if possible the latest and one that's at least 5 months old. I tried it with virtual box but while virtualbox is great and free, its missing features that are crucial to reproducing my prod environment locally.

I have a few setups: Primary Setup: VM Host OS: macOS VM Host Software: VMware Fusion 15 Package Manager used to source tool: Homebrew

Secondary Setup: VM Host OS: Windows 10 VM Host Software: VMware Workstation Pro 15 Package Manager used to source tool: Chocolatey

For reference VMware boxes I've used before are: salesforce/server2019_core StefanScherer/windows_2019_docker

gusztavvargadr commented 4 years ago

@aescolastico thanks for the details, I do not own a VMware license so will try to build first with the free tooling. I don't have an actual timeline yet, but will link any work here to keep you up to date.

Just curious, what features are you missing from VirtualBox? I myself use primarly Hyper-V on Windows, and my intention was to build VirtualBox as well for enabling cross-platform setups, but if VMware is just better, I'm glad to support that primarily as well.

Btw, I publish new versions of the boxes once a month with all the latest updates, and plan for a 6 months retention by default at the moment, I hope that works for you then as well.

@StefanScherer is actually following this thread, so he might add some comments :) I would absolutely trust him on any Windows Server and Docker-related workload, but I have a few attempts as well at https://app.vagrantup.com/gusztavvargadr/boxes/docker-windows, let us know how we could improve these :)

aescolastico commented 4 years ago

Mainly stability. I use loops to spin up 500+ vagrant machines in a single vagrant file with various provisioner tasks. This works fine when using VMware Providers. Virtual box for some reason has issues when I push it past 50.

I haven't personally had any need for docker on windows. I mainly used Stefans box as its one of the better core images in the public repo.

StefanScherer commented 4 years ago

I used Vagrant + VMware Workstation Pro for some years on a Windows 7 notebook. Since 2014 I have a MBP and Vagrant both with VirtualBox, but also bought VMware Fusion Pro short after. I switched to the Pro version of VMware because of the snapshot feature (vagrant snapshot) and linked clones (instant vagrant up without copying lot of GBytes on the disk). (Both features are built in Vagrant using VirtualBox)

The reason for VMware is better performance on the shared folder, better full retina (HiDPI) support, and nested virtualization (eg. run a Windows 10 VM to test Docker Desktop that needs Hyper-V, or run a nested macOS VM to test a new version of macOS, Vagrant and/or VMware).

I just looked up, VirtualBox 6.1 seems to add nested virt for newer Intel CPU's, something I have to try out. HiDPI support also landed in VirtualBox. So, the difference might be less nowadays.

Packer + VMware works with the 30 days trial of VMware Workstation/Fusion. Vagrant + VMware doesn't work as a "trial" as Hashicorp's VMware plugin doesn't have a trial period. After a major release of VMware you have to buy an update of the Vagrant VMware plugin. But I always took that way as it helped me to support newer OS versions (both host and inside a VM).

To support VMware in the packer templates, adding the vmware-iso builder section, installing the VMware tools instead of the VirtualBox guest additions, and adding some settings to the Vagrantfile template are the major steps needed.

gusztavvargadr commented 4 years ago

@StefanScherer thanks heaps for the details, I appreciate it.

vineetgupt commented 3 years ago

Hi @gusztavvargadr, VMware provider support from vagrant is free now. Your windows-10 is used by so many people, and one of few quality images available. Please consider adding support for VMware Desktop (new name for provider).

I will be more than willing to land a helping hand, if needed :)

gusztavvargadr commented 3 years ago

@vineetg thank you, I've been a bit on and off recently releasing new versions, but started picking up this project recently again. I plan to extend support for multiple providers and build platforms soon, good to know that Vagrant has free support now for VMware :)

gusztavvargadr commented 2 years ago

@aescolastico @vineetg it took some time but I finally have some basic VMware boxes as well. I'd appreciate if you could check these out and let me know what you think:

I've built these as a first iteration, but I can add the VMware provider for the other boxes too if needed.

StefanScherer commented 2 years ago

That's awesome, thank you @gusztavvargadr !! I've tried windows-server and windows-10 VMware boxes and they work, the VMware tools are installed, shared folder works. 🎉

Windows 11 can be a bit tricky, my box currently often crashes on boot, some retries made it work, but I have no idea how to work around that problem. Maybe I have to read through https://kb.vmware.com/s/article/86207

gusztavvargadr commented 2 years ago

@StefanScherer thank you, and of course thanks for all the help with this so far, I appreciate it 👍

Windows 11 is tricky indeed, I tried so far only with Hyper-V and VirtualBox. With the former you can manage all the requirements (vTPM and Secure Boot) easily, but then the machine will be importable only by importing the Hyper-V private keys as well from the machine that built them, so it's less useful for a public Vagrant box.

I saw also on this option, disabling the checks, but then it is actually a not supported configuration, so I would expect issues. Will share if I find anything useful, just getting started with VMware now :)

I also tried the same setup I have with Docker Desktop (and Visual Studio) and Windows 10 to build for Windows 11, for now it failes during Sysprep, I need to look into it more how to enable that configuration.

eszatmary-scwx commented 2 years ago

Hello @gusztavvargadr, I was able to obtain the windows-11 Vagrant box on 24 June 2022 with VMware provider support:

PS D:\> get-content D:\vagrant-boxes\windows\win11\.vagrant\machines\default\vmware_desktop\box_meta
{"name":"gusztavvargadr/windows-11","version":"2102.0.2112","provider":"vmware_desktop","directory":"boxes/gusztavvargadr-VAGRANTSLASH-windows-11/2102.0.2112/vmware_desktop"}

I see that VMware provider support for the windows-11 Vagrant box is no longer available on Vagrant Cloud.

Will you be providing VMware provider boxes on Vagrant Cloud for Windows 11 and ideally Windows Server 2022 in the near future?

Your Vagrant boxes are a wonderful contribution to the community already, but many of my team members and industry collaborators use VMware products.

gusztavvargadr commented 2 years ago

@eszatmary-scwx thanks for your kind words and sorry for the inconvenience.

I've built those boxes only experimentally so far, and did not include them in my regular release cycle. I usually clean up box versions after 6 months, so that's why those versions disapperaed.

I have a pending release anyway after the recent Patch Tuesday, so I will include new versions for them, hopefully they will last until I add proper regular support. Will keep you posted in this thread.

eszatmary-scwx commented 2 years ago

Thank you very much for the quick response and consideration!

gusztavvargadr commented 1 year ago

@eszatmary-scwx sorry for the delay on this, had to take a break from this project for a while.

I am about to start the regular release rythm again and would consider adding this for most of the boxes.

Thanks!

gusztavvargadr commented 1 year ago

@eszatmary-scwx and others, I have added back the VMware provider for the following boxes:

https://app.vagrantup.com/gusztavvargadr/boxes/windows-server https://app.vagrantup.com/gusztavvargadr/boxes/windows-server-2022-standard

https://app.vagrantup.com/gusztavvargadr/boxes/windows-server-core https://app.vagrantup.com/gusztavvargadr/boxes/windows-server-2022-standard-core

https://app.vagrantup.com/gusztavvargadr/boxes/windows-11 https://app.vagrantup.com/gusztavvargadr/boxes/windows-11-22h2-enterprise

https://app.vagrantup.com/gusztavvargadr/boxes/windows-10 https://app.vagrantup.com/gusztavvargadr/boxes/windows-10-22h2-enterprise

I plan to include these from now on in the regular monthly release cadence, and will add the VMware provider to the rest of my boxes gradually, but please let me know if you have a box you already miss.

Thanks all again for the patience.

Oscaner commented 1 year ago

That's awesome, thank you @gusztavvargadr !! I've tried and VMware boxes and they work, the VMware tools are installed, shared folder works. windows-server``windows-10🎉

Windows 11 can be a bit tricky, my box currently often crashes on boot, some retries made it work, but I have no idea how to work around that problem. Maybe I have to read through https://kb.vmware.com/s/article/86207

Hi @StefanScherer,

Do you know how to set up the windows-10? I used Vagrant & VMware Fusion, but it always timeout.

VM Host OS: Mac M1 Pro, Ventura 13.4.1 VM Host Software: VMware Fusion 13.0.2 Package Manager used to source tool: Homebrew Vagrantfile: https://github.com/Oscaner/vagrant/blob/master/win10/Vagrantfile

image
gusztavvargadr commented 1 year ago

@Oscaner The box you try to run is built for x86, while you seem to try to run it on an ARM platform, I doubt this will work.

Here's a video describing the process of running Windows 11 on a Mac M1: https://www.youtube.com/watch?v=srOty2jflF4

I will consider adding ARM-based boxes later.

Oscaner commented 1 year ago

@gusztavvargadr Thanks! I will try the qemu-img first.

gusztavvargadr commented 9 months ago

FYI, all my boxes (including earlier versions of OSes and tools, including even the insider previews of Windows) published as of version 2312 support VMware and it will be a standard provider going forward for all future versions and boxes.

Thank you all for the help and patience with this. I close this issue now, but please let me know.