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

feat: enable virtual hardware-assisted virtualization #213

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

tenthirtyam
Copy link
Collaborator

Description

Adds explicit option to enable virtual hardware-assisted virtualization.

vhv_enabled (bool) - Enable virtual hardware-assisted virtualization for the virtual machine. Defaults to false.

vhv_enabled = true

Testing

packer-plugin-vmware on  feat/enable-vhvgo fmt ./...

packer-plugin-vmware …make generate
2024/07/02 00:33:05 Copying "docs" to ".docs/"
2024/07/02 00:33:05 Replacing @include '...' calls in .docs/
Compiling MDX docs in '.docs' to Markdown in '.web-docs'...

packer-plugin-vmware on  feat/enable-vhvmake build

packer-plugin-vmware on  feat/enable-vhvmake dev
packer plugins install --path packer-plugin-vmware "github.com/hashicorp/vmware"
Successfully installed plugin github.com/hashicorp/vmware from /Users/ryan/Library/Mobile Documents/com~apple~CloudDocs/Code/Personal/packer-plugin-vmware/packer-plugin-vmware to /Users/ryan/.packer.d/plugins/github.com/hashicorp/vmware/packer-plugin-vmware_v1.0.12-dev_x5.0_darwin_arm64

packer-plugin-vmware on  feat/enable-vhvmake test
?       github.com/hashicorp/packer-plugin-vmware       [no test files]
?       github.com/hashicorp/packer-plugin-vmware/version       [no test files]
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/common 6.601s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/iso    1.829s
ok      github.com/hashicorp/packer-plugin-vmware/builder/vmware/vmx    2.207s

If vhv_enabled = true, results in the following in the .vmx:

...
uuid.action = "create"
vhv.enable = "TRUE"
virtualhw.productcompatibility = "hosted"
...

If vhv_enabled = false or not provided, results in the following in the .vmx:

...
uuid.action = "create"
vhv.enable = "FALSE"
virtualhw.productcompatibility = "hosted"
...

Reference

Closes #41

Copy link
Contributor

@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.

This looks good to me. I left a couple of suggestions to lean on the template engine for converting boolean types to strings.

builder/vmware/iso/step_create_vmx.go Outdated Show resolved Hide resolved
builder/vmware/iso/step_create_vmx.go Outdated Show resolved Hide resolved
Adds explicit option to enable virtual hardware-assisted virtualization.

Ref: #41

Signed-off-by: Ryan Johnson <ryan@tenthirtyam.org>
Copy link
Contributor

@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.

The updates look great! :shipit:

@nywilken nywilken merged commit 9354df9 into main Jul 5, 2024
12 checks passed
@nywilken nywilken deleted the feat/enable-vhv branch July 5, 2024 13:26
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.

Add property to set the vhv.enable vmx property
2 participants