-
Notifications
You must be signed in to change notification settings - Fork 909
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
govc: fix default guest.run path for unsupported Windows guests #2451
Conversation
Thx Doug, I'm fine with the code changes but was wondering why we don't allow to overwrite the SHELL but depend on the OS type instead? Wouldn't changing the SHELL be more flexible instead of introducing that new windows specific parameter? |
@embano1 we can override if an absolute path is given, for example: % govc guest.run -vm foo /usr/local/bin/any-program ... The os family based % govc guest.run -vm foo c:\\Windows\\System32\\cmd.exe /c powershell c:\\bar.ps1 Instead of: % govc guest.run -vm foo -w powershell c:\\bar.ps1 |
Thx for confirming my assumption that this is possible today, but adding |
Yeah, windows is the exception. Instead of adding modified govc/vm/guest/guest.go
@@ -88,12 +88,18 @@ func (flag *GuestFlag) Toolbox() (*toolbox.Client, error) {
family := ""
var props mo.VirtualMachine
- err = vm.Properties(context.Background(), vm.Reference(), []string{"guest.guestFamily"}, &props)
+ err = vm.Properties(context.Background(), vm.Reference(), []string{"guest.guestFamily", "guest.toolsInstallType"}, &props)
if err != nil {
return nil, err
}
if props.Guest != nil {
family = props.Guest.GuestFamily
+ if family == string(types.VirtualMachineGuestOsFamilyOtherGuestFamily) {
+ if props.Guest.ToolsInstallType == string(types.VirtualMachineToolsInstallTypeGuestToolsTypeMSI) {
+ // The case of Windows version not supported by the ESX version
+ family = string(types.VirtualMachineGuestOsFamilyWindowsGuest)
+ }
+ }
}
return &toolbox.Client{ |
Nice, I like that much better! No (breaking) change for user and it will behave accordingly to what users would expect (see issue). |
ok, done @embano1 👍 |
- Default to Windows family when family is "Other" and toolsInstallType is MSI Fixes vmware#2446
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes: #2446