Skip to content
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

Parallels support? #74

Open
ntodorov opened this issue Oct 8, 2020 · 6 comments
Open

Parallels support? #74

ntodorov opened this issue Oct 8, 2020 · 6 comments

Comments

@ntodorov
Copy link

ntodorov commented Oct 8, 2020

Is it doable to add Parallels support for macOS host?
Seems they have a vagrant https://parallels.github.io/vagrant-parallels/docs/

My impression is that Parallels the preferred Mac solution, seems better optimized for Mac than VirtualBox, and according to some posts even than VMWareFusion.

Thanks,
Nik

@StefanScherer
Copy link
Owner

StefanScherer commented Oct 9, 2020

Hi @ntodorov
Yes, I think that is doable.
But I don't have a Parallels license that's why I never had experience with Packer and Vagrant with Parallels.
From what I see it should work, nested virtualization is there for hyperv containers.

For a regular rebuild of the Vagrant box I see a problem, I don't have a parallels license and no Mac hardware to spare to run my packer-builder pipeline in the cloud somewhere. I normally only build VirtualBox and VMware boxes every 1-2 months.

But for a local build for someone who has Parallels it would require a change in https://github.com/StefanScherer/packer-windows/blob/main/windows_2019_docker.json to add a packer parallels builder section in the packer build and maybe adding parallels guest tools(?). it's just a packer build away:

$ git clone https://github.com/StefanScherer/packer-windows
$ cd packer-windows
$ packer build --only=parallels-iso windows_2019_docker.json
$ vagrant box add windows_2019_docker windows_2019_docker_parallels.box
$ dm start 2019

And let's see how the virtualization landscape evolves on macOS with the now free for personal use VMware Fusion Player. Vagrant still wants some money for the plugin and I don't know if Player works well with the Vagrant plugin. Maybe there will be a free Player plugin from the community...

@ammar-mik
Copy link

I can confirm that building parallels locally works.

However, I get and error on vagrant box add windows_2019_docker windows_2019_docker_parallels.box:

==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'windows_2019_docker' (v0) for provider: 
    box: Downloading: windows_2019_docker_parallels.box
An error occurred while downloading the remote file. The error
message, if any, is reproduced below. Please fix this error and try
again.

Couldn't open file /Users/me/code/packer-windows/windows_2019_docker_parallels.box

@earljon
Copy link

earljon commented Aug 8, 2021

In any case that other people is looking for an update on this issue.
I am able to build a working Parallels box locally using my Macbook running packer. The above posted by @StefanScherer steps definitely worked!

If you like to try it yourself, make sure you have:

If you have Homebrew installed, you can install the SDK by:

Install Parallels Virtualization SDK
$ brew cask install parallels-virtualization-sdk

I was not able to experience the issue that @ammar-mik posted above with this command:

$ vagrant box add earljon/windows_2019_docker /Users/ehidalgo/vbox/windows_2019_docker_parallels.box
==> box: Box file was not detected as metadata. Adding it directly...
==> box: Adding box 'earljon/windows_2019_docker' (v0) for provider:
    box: Unpacking necessary files from: file:///Users/ehidalgo/vbox/windows_2019_docker_parallels.box
==> box: Successfully added box 'earljon/windows_2019_docker' (v0) for 'parallels'!

To verify your box:

❯ vagrant box list
earljon/windows_2019_docker       (parallels, 0)

NOTE:

  • Generated .box file is around ~15GB
  • Estimated time of completing the packer build is around ~2.5 hours. Will vary depending on your machine spec.

For running Vagrantfile, just add the new box in your config file and run:

$ vagrant up --provider parallels 2019-box-parallels

Issues and Fixes:

  • You will notice that the script create-machine.ps1 will fail as the synced_folder mapping is unable to reach from the guest OS with an error of The network path is not found.
  • The fix is you need to install the Parallels Tools in the Guest OS to be able for the Shared Folder to work. This is also evident during the vagrant up process:
==> 2019-box-parallels: Machine booted and ready!
==> 2019-box-parallels: Checking for Parallels Tools installed on the VM...
==> 2019-box-parallels: Parallels Tools were not detected on this VM! They are required
==> 2019-box-parallels: for shared folders, time sync and more. If shared folders are not
==> 2019-box-parallels: working on this machine, please install Parallels Tools within the
==> 2019-box-parallels: virtual machine and reload your VM.
  • Parallels Tools is located in /Applications/Parallels Desktop, right-click, Show Package contents, Resources/Tools
  • You will encounter an error in printui.dll but you can just click OK to proceed with installation. After it finished, a reboot is required. Hit the Reboot button and after that, the synced_folder will now work and you just need to rerun vagrant up with --provision

Hope this steps helps someone trying to run under Parallels provider.
Thank you @StefanScherer for providing this wonderful repository!

@zhex900
Copy link

zhex900 commented Jan 9, 2022

Is nested virtualization a requirement?

Parallel on Apple Silicon does not support nested virtualization. Without nested virtualization, this will not work on M1 macs?

@zhex900
Copy link

zhex900 commented Jan 9, 2022

windows_2019_docker_parallels.box

@earljon can you share the infra code you used to pack the windows_2019_docker_parallels image?

@StefanScherer
Copy link
Owner

Nested virtualisation is needed whey you want to run Windows containers in hyperv isolation mode. With the process isolation mode I remember you don't need nested virtualisation.

But running Windows containers on a Mac M1 machine I'm not sure if that works. Windows is amd64, I know that eg. VMware does not support running this on M1. I don't know about Parallels, but would think they have the same problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants