-
Notifications
You must be signed in to change notification settings - Fork 241
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
Default Switch using special characters might fail start (VM creation in driver) #758
Comments
Along the way I will refactor and perhaps even remove some code related to 'choosing the Virtual Switch': https://github.com/code-ready/machine/blob/0fde37b5d95b668d82659ec4aa1d60b054a08e46/drivers/hyperv/hyperv.go#L179 as the code still picks up the first one by default? Ref: https://github.com/code-ready/machine/blob/0fde37b5d95b668d82659ec4aa1d60b054a08e46/drivers/hyperv/hyperv.go#L227-L264 func (d *Driver) chooseVirtualSwitch() (string, error) {
if d.VirtualSwitch == "" {
// Default to the first external switch and in the process avoid DockerNAT
stdout, err := cmdOut("[Console]::OutputEncoding = [Text.Encoding]::UTF8; (Hyper-V\\Get-VMSwitch -SwitchType External).Name")
if err != nil {
return "", err
}
switches := parseLines(stdout)
if len(switches) < 1 {
return "", fmt.Errorf("no external virtual switch found. A valid virtual switch must be available for this command to run")
}
return switches[0], nil
}
stdout, err := cmdOut("[Console]::OutputEncoding = [Text.Encoding]::UTF8; (Hyper-V\\Get-VMSwitch).Name")
if err != nil {
return "", err
}
switches := parseLines(stdout)
found := false
for _, name := range switches {
if name == d.VirtualSwitch {
found = true
break
}
}
if !found {
return "", fmt.Errorf("virtual switch %q not found", d.VirtualSwitch)
}
return d.VirtualSwitch, nil
} |
Force encoding with |
@robin-owen What about documentation around this? As a known issue we can detail that this can happen. However, it is solved now and will be fixed in the next release. |
@gbraad Is there a workaround for this issue other than setting the OS language to English? |
@robin-owen there is, in the form of a new release. this change has been merged and 'should' work. |
In Swedish the Default Switch is named "Standardväxel" which might cause issues upon creation of the VM.
The text was updated successfully, but these errors were encountered: