Commit Graph

13 Commits

Author SHA1 Message Date
Paul Holzinger ce07860a1c
machine: fix default connection URL to use 127.0.0.1
gvproxy listens on 127.0.0.1, using localhost as hostname can result in
the client trying to connect to the ipv6 localhost (`::1`). This will
fail as shown in the issue. This switches the hostname in the system
connection to 127.0.0.1 to fix this problem.
I switched the qemu, hyperV and WSL backend. I haven't touched the
applehv code because it uses two different ips and I am not sure what is
the correct thing there. I leave this to Brent to figure out.

[NO NEW TESTS NEEDED]

[1] https://github.com/containers/gvisor-tap-vsock/blob/main/cmd/gvproxy/main.go#L197-L199

Fixes #16470

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-05-16 10:55:31 +02:00
Jason T. Greene 5a176f09c2 Set machine docker.sock according to rootful flag
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-05-14 23:56:15 -05:00
OpenShift Merge Robot cf29dad400
Merge pull request #18402 from baude/applehvpass1
MVP for Podman Machine with AppleHV
2023-05-03 10:17:51 -04:00
Brent Baude dc7515dc32 MVP for Podman Machine with AppleHV
this pr is the first pass at enabling podman machine to use the apple hypervisor. there are still several TODO
areas like host networking.  once the decision is handled on what host networking should look like, these TODOs
should be fairly quick to resolve.  they also will impact the remove methods.

you must also have vfkit (https://github.com/crc-org/vfkit)

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-05-02 13:09:56 -05:00
Paul Holzinger 64959b744f
pkg/machine: rework RemoveConnection()
It really does not make sense to call RemoveConnection() twice and then
update the config file a third time in updateDefaultMachineinConfig().
This results in unnecessary reads/writes and more code.

Simplyfy this into one function that is only called once and do all
updates at once.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-26 16:57:22 +02:00
Brent Baude 8019dc9e60 hyperv: add podman socket mapping
on machine start, create a socket representing the machine's podman
service socket so local (to the host) applications can take advanatge of
it.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-04-19 16:41:34 -05:00
Brent Baude 4b8230119e HyperV: wait on stop
When using podman machine with hyperv, stop was releasing the terminal
back top the user prematurely.  This resulted in users being able to run
subsequent commands while the vm was still stopped.  Commands like
machine stop were prone to failing.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-04-18 08:02:48 -05:00
Brent Baude 3222545ad5 Enabled network over vsock
podman machine with Microsoft HyperV will use hvsock on the guest and
vsock on the guest for its networking.  this pr enables the basics for
this to happen as well as changes to ignition to automatically set this
up with network manager.

the vm binary referenced in this pr is in containers/gvisor-tap-vsock
and will need to be added to distributions.

[NO NEW TESTS NEEDED]
Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-04-17 12:34:37 -05:00
Brent Baude f488d9890c Add support for HVSOCK on hyperv
Windows HyperV uses HVSocks (Windows adaptation of vsock) for
communicating between vms and the host.  Podman machine in Qemu uses a
virtual UDS to signal the host that the machine is booted.  In HyperV,
we can use a HVSOCK for the same purpose.

One of the big aspects of using HVSOCK on Windows is that the HVSOCK
must be entered into the Windows registry.  So now part of init and rm
of a podman machine, entries must be added and removed respectively.
Also duplicates are a no-no.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-04-14 13:53:25 -05:00
OpenShift Merge Robot ac2efdb862
Merge pull request #17949 from baude/hypervset
implement podman machine set for hyperv
2023-03-28 17:41:40 +02:00
Brent Baude 51d068ecc7 implement podman machine set for hyperv
add the ability to set cpu and processor counts on an existing vm.

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]
2023-03-27 16:11:24 -05:00
Brent Baude 518eafaa34 hyperv: lookup machine on local filesystem first
when looking for a machine, look it up locally first to prevent
accidental collision with non-podman machine vms.  in the cast of
`podman machine ls`, only list podman machines found by json files

Enabled remove with force.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-03-27 10:17:06 -05:00
Brent Baude 0dac214f56 basic hypverv machine implementation
with libhvee, we are able to do the basics of podman machine management
on hyperv.  The basic functions like init, rm, stop, and start are all
functional.  Start and stop will periodically throw a benign error
processing the hyperv message being returned from the action.  The error
is described in the todo's below.

notable items:

* no podman commands will work (like ps, images, etc)
* the machine must be initialized with --image-path and fed a custom image.
* disk size is set to 100GB statically.
* the vm joins the default hyperv network which is TCP/IP network based.
* podman machine ssh does not work
* podman machine set does not work
* you can grab the ip address from hyperv and fake a machine connection
  with `podman system connection`.
* when booting, use the hyperv console to know the boot is complete.

TODOs:
* podman machine ssh
* podman machine set
* podman machine rm needs force bool
* disk size in NewMachine is set to 100GB
* podman start needs to wait until fully booted
* establish a boot complete signal from guest
* implement gvproxy like user networking
* fix benign failures in stop/start -> Error: error 2147749890 (FormatMessage failed with: The system cannot find message text for message number 0x%1 in the message file for %2.)

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-03-17 16:02:28 -05:00