79 Commits

Author SHA1 Message Date
b07e735661 Merge pull request #11434 from coypoop/patch1
Spell "build linux darwin" as "build !windows".
2021-09-07 17:27:45 +02:00
7a667c4ac3 Use default username for podman machine ssh
When using the defaut conection for podman machine ssh, use the default
username too.

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-09-03 16:40:13 -04:00
8d9e19b035 Spell "build linux darwin" as "build !windows".
Equivalent for supported platforms, and makes it easier to support
additional unix-like OSes.

[NO TESTS NEEDED]

Signed-off-by: Maya Rashish <maya@NetBSD.org>
2021-09-03 13:38:14 +03:00
90998176d9 machine: always check error of net.Dial, even after last try
When net.Dial always fail in the above loop, the code following the loop
is executed. This error check prevents this.

[NO TESTS NEEDED]

Signed-off-by: Guillaume Rose <gurose@redhat.com>
2021-09-03 09:10:35 +02:00
a2a166345e clean up socket and pid files from podman machine
to avoid segvs, we should clean up as much of the socket and regular
files from podman machine as possible on stop.  also, on start, we
should add logic to remove these files before starting in case the start
process is stopped prematurely (due to an error for example).

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-08-30 12:29:06 -05:00
3f22e52964 Allow setting of machine stream and image path from containers.conf
Default is "testing"

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-08-24 14:18:55 -04:00
9fc9465630 Set gvproxy path to /usr/libexec/podman/gvproxy
We have reverted the previous patches to look for the gvproxy binary in
/usr/lib/podman and have again decided to use /usr/libexec/podman

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-08-12 09:11:09 -05:00
643178c1ec Revert "Use static path for gvproxy"
This reverts commit 4acc1d685066faa1dc102532ba76a81d3ec6bdc0.

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-08-11 14:39:00 -05:00
e52187e7fe show podman machine ssh command line
A user contributed a one line PR that enabled logging the podman machine
ssh command for debug. The user was not able to complete the submission
so this PR replaces that.

[NO TESTS NEEDED]

Replaces #10798

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-08-05 12:38:21 -05:00
4acc1d6850 Use static path for gvproxy
Given that we do not want to support gvproxy for anything other than
podman machine, we have decided to use a static path of
/usr/lib/podman/gvproxy instead of a lookpath.

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-08-03 09:25:06 -05:00
0c9dc86dea Create podman temp dir on machine start
If the tempdir for the OS does not have a podman/, machine start will fail.  An example would be after a reboot.  We now create the podman dir if it does not exist.

Fixes #10824

[NO TESTS NEEDED]

Signed-off-by: baude <baude@baudes-Mac-mini.localdomain>
Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-07-02 12:41:51 -05:00
c3a14103fb Fix build tags for pkg/machine...
Podman machine is only intended for amd64 and arm64 architectures, set
the correct buildtags so that the `pkg/machine`, `pkg/machine/qemu` and
`pkg/machine/libvirt` packages compile correctly.

[NO TESTS NEEDED]

Fixes #10625

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-06-10 10:25:16 +02:00
7ef3981abe Enable port forwarding on host
Using the gvproxy application on the host, we can now port forward from
the machine vm on the host.  It requires that 'gvproxy' be installed in
an executable location.  gvproxy can be found in the
containers/gvisor-tap-vsock github repo.

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-06-01 10:13:18 -05:00
8e5388e41d Add options to podman machine ssh
Add options to the podman machine ssh command that ignore
hostkeychecking and hosts file

-o 'UserKnownHostsFile /dev/null' -o 'StrictHostKeyChecking no

[NO TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-05-27 09:10:39 -05:00
53057d5c20 Check if another VM is running on machine start
Only one VM can be up at a time. If another VM is running, or the current VM is running, error out on a podman machine start

[NO TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-04-28 15:09:10 -04:00
f8bc391e34 Add ssh connection to root user
When initing a VM, create two add connections - one to user, one to
root.
podman machine remove removes both connections as well.

[NO TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-04-01 13:51:02 -04:00
f6438d36f3 Remove --execute from podman machine ssh
The --execute flag ended up serving no purpose.  It was removed and
documentation was updated.

Fixed a panic when no VM name was provided.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-03-31 12:51:33 -05:00
2d824d85e1 Merge pull request #9888 from baude/machineign
podman machine init --ignition-path
2021-03-31 15:24:47 +02:00
a373e2fdf3 Merge pull request #9885 from ashley-cui/machinels
Add podman machine ls
2021-03-30 22:36:25 +02:00
ef4e91a59e Add podman machine list
podman machine list lists all virtual machines & indicates the default VM
connection, if it exists. it also can take a --format flag arg as a go
template.

[NO TESTS NEEDED]

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-03-30 14:56:21 -04:00
f7ad9fbd9e Merge pull request #9873 from baude/correctaarch64
resolve proper aarch64 image names
2021-03-30 17:09:58 +02:00
b898b19e45 podman machine init --ignition-path
allow for the user to provide an alternate ignition-file rather than the
auto-generated one.

updated docs to describe ramifications of providing an alterate ignition
file.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-03-30 09:44:04 -05:00
b6089a5e99 resolve proper aarch64 image names
when automatically downloading fcos for the Apple M1, we needed
to replace a statically defined URL with the dynamically
determined one.

also, it appears boolean qemu options `server` and `onwait` are
not defined as `server=on` and `wait=off`.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-03-29 20:20:39 -05:00
236798e001 podman machine init user input
users may now provide a fully qualified local file path or a URL to seed
the disk-image to be used in the VM.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-03-29 14:42:45 -05:00
7a79f708a4 Podman machine enhancements
Podman machine remove is now called `rm`.

Podman machine create now supports resizing the image to the value of
--disk-size as provided.  The default is to 10G.

Added systemd unit file on guest via ignition that sends a Ready message
to the host over a virtio-socket so that we know when the VM is booted
and ready for use.

Podman machine commands no longer require a VM name as an argument.  A
default VM name is defined and if no VM name is provided as a arg, the
default will be used.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-03-27 10:08:11 -05:00
f663857103 Rename podman machine create to init and clean up
Rename podman machine create to init because we're initing a VM, not
really creating it
Wire up CPUs flag
Suppress QEMU GUI from popping up when not in debug mode

[NO TESTS NEEDED]
Signed-off-by: Ashley Cui <acui@redhat.com>
2021-03-25 17:45:27 -04:00
4ab8a6f67e Improvements for machine
clean up ci failures and add appropriate arch,os exclusion tags

Signed-off-by: baude <bbaude@redhat.com>
2021-03-25 11:02:33 -05:00
e766113737 Add --execute flag to podman machine ssh
--execute, -e allows to execute a command through ssh

Signed-off-by: Ashley Cui <acui@redhat.com>
2021-03-25 08:46:43 -05:00
b5f54a9b23 introduce podman machine
podman machine allows podman to create, manage, and interact with a vm
running some form of linux (default is fcos).  podman is then configured
to be able to interact with the vm automatically.

while this is usable on linux, the real push is to get this working on
both current apple architectures in macos.

Ashley Cui contributed to this PR and was a great help.

[NO TESTS NEEDED]

Signed-off-by: baude <bbaude@redhat.com>
2021-03-25 08:43:51 -05:00