Skip to content

Commit

Permalink
Enable QEMU Podman machine on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Arthur Sengileyev <[email protected]>
  • Loading branch information
arixmkii committed Jan 6, 2024
1 parent 19678e3 commit eccb0da
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 1 deletion.
11 changes: 11 additions & 0 deletions pkg/machine/e2e/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,17 @@ Note: To run specific test files, add the test files to the end of the winmake c

`./winmake localmachine "basic_test.go start_test.go"`

### QEMU
1. Install QEMU and add it to either user or sysmem PATH variable
1. Install Podman release (needed to have gvproxy binary)
1. Open a powershell as a regular user
1. $env:CONTAINERS_MACHINE_PROVIDER="qemu"
1. `./winmake localmachine`

Note: To run specific test files, add the test files to the end of the winmake command:

`./winmake localmachine "basic_test.go start_test.go"`

## MacOS

### Apple Hypervisor
Expand Down
2 changes: 1 addition & 1 deletion pkg/machine/e2e/config_windows_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
const podmanBinary = "../../../bin/windows/podman.exe"

func getDownloadLocation(p machine.VirtProvider) string {
if p.VMType() == define.HyperVVirt {
if p.VMType() == define.HyperVVirt || p.VMType() == define.QemuVirt {
return getFCOSDownloadLocation(p)
}
fd, err := wsl.NewFedoraDownloader(define.WSLVirt, "", defaultStream.String())
Expand Down
3 changes: 3 additions & 0 deletions pkg/machine/e2e/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ var _ = Describe("podman machine init", func() {
Skip("volumes are not supported on hyperv yet")
}
skipIfWSL("WSL volumes are much different. This test will not pass as is")
if testProvider.VMType() == define.QemuVirt && runtime.GOOS == "windows" {
Skip("volumes are not yet supported on official qemu builds running under Windows")
}

tmpDir, err := os.MkdirTemp("", "")
Expect(err).ToNot(HaveOccurred())
Expand Down
2 changes: 2 additions & 0 deletions pkg/machine/provider/platform_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ func Get() (machine.VirtProvider, error) {
return wsl.VirtualizationProvider(), nil
case define.HyperVVirt:
return hyperv.VirtualizationProvider(), nil
case define.QemuVirt:
return getQemuProvider()
default:
return nil, fmt.Errorf("unsupported virtualization provider: `%s`", resolvedVMType.String())
}
Expand Down
10 changes: 10 additions & 0 deletions pkg/machine/provider/platform_windows_amd64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package provider

import (
"github.com/containers/podman/v4/pkg/machine"
"github.com/containers/podman/v4/pkg/machine/qemu"
)

func getQemuProvider() (machine.VirtProvider, error) {
return qemu.VirtualizationProvider(), nil
}
12 changes: 12 additions & 0 deletions pkg/machine/provider/platform_windows_arm64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package provider

import (
"fmt"

"github.com/containers/podman/v4/pkg/machine"
"github.com/containers/podman/v4/pkg/machine/define"
)

func getQemuProvider() (machine.VirtProvider, error) {
return nil, fmt.Errorf("unsupported virtualization provider: `%s`", define.QemuVirt.String())
}

0 comments on commit eccb0da

Please sign in to comment.