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

Add support for running within WSL2 #57

Merged
merged 2 commits into from
Sep 22, 2023
Merged

Conversation

camjjack
Copy link
Contributor

@camjjack camjjack commented Feb 12, 2022

Support for running from within WSL2.

Similar to vagrant it will work when run from a windows filesystem within wsl i.e. /mnt/c/Users/user/...
Further, PACKER_CACHE_DIR needs to be set to a path on the windows filesystem.

This is all I needed for my testing to work.
/mnt/c/Users/user/packer-plugin-hyperv$ PACKER_CACHE_DIR=/mnt/c/Users/user/.packer packer build ...

Closes #38

@camjjack camjjack requested a review from a team as a code owner February 12, 2022 23:52
@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@maroskukan
Copy link

It would be great to include this feature in next release. I also ran into this limitation in Linux environment in WSL2 where I have all dev tools, forcing me to switch to Powershell in Windows.

@bendem
Copy link

bendem commented Oct 5, 2022

This sounds great, would definitely use it!

@camjjack camjjack changed the title [WIP] Support for running within WSL2 Support for running within WSL2 Mar 25, 2023
@nywilken
Copy link
Member

Hi @camjjack thanks for opening up this change. Overall it looks good. I will pull it down and give it a round of testing, and a closer review. I'm releasing 1.1.1 today to get out the TPM change but will follow up with this change for the next release.

@nywilken
Copy link
Member

In the meantime, can you please rebase onto main to pull in the latest changes to the plugin.

@camjjack
Copy link
Contributor Author

Thanks @nywilken, I've rebased onto main and pushed.

@nywilken nywilken changed the title Support for running within WSL2 Add support for running within WSL2 Sep 22, 2023
Copy link
Member

@nywilken nywilken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camjjack apologies for the delayed response. I was unable to prioritize this review until now. I do apologize. I tested your changes and I am able to build in a WSL environment without issue (well I had to play with my default switch a little for hyperv) but that is outside of WSL. I'll rebase and merge in your changes.

@nywilken nywilken merged commit 800b1df into hashicorp:main Sep 22, 2023
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WSL 2 + Hyper-V: "Applies to Windows 8.1, Windows PowerShell 4.0, Windows Server 2012 R2 only"
5 participants