boot2podman / machine

Apache License 2.0
120 stars 16 forks source link

How can we install podman-remote #14

Closed cmoulliard closed 5 years ago

cmoulliard commented 5 years ago

Question

How can we install podman-remote which is defined here within the doc https://github.com/boot2podman/machine#podman-remote ? Where such app/project is maintained ?

ooodigi commented 5 years ago

At this time, the remote-client is not being packaged for any distribution. It must be built from source.

Building the remote client

cmoulliard commented 5 years ago

Remote client is available from the download web site : https://console.cloud.google.com/storage/browser/libpod-master-releases?authuser=0&pli=1

afbjorklund commented 5 years ago

It is maintained in github.com/containers/libpod, next to regular podman

afbjorklund commented 5 years ago

Maybe I should provide links to where to get the client

seriousme commented 5 years ago

I can use podman using podman-machine ssh but using podman-remote seems to be a quagmire of non consistent settings between podman-remote and podman-machine. See: https://github.com/containers/libpod/issues/3151

Has anyone gotten this setup working on Windows ?

afbjorklund commented 5 years ago

I have never tried the DOS Command Prompt, but once upon a time it worked OK when using a bash shell (such as MSYS2). The varlink commands have been updated a bit, and should work better now.

afbjorklund commented 5 years ago

Actually I think I only tried varlink command last time, since podman-remote was not yet available.

seriousme commented 5 years ago

Just to be sure:

Box is running at 192.168.99.100 (not localhost) and using user tc

>podman-machine ssh box whoami
tc
>podman-machine ls
NAME   ACTIVE   DRIVER       STATE     URL                    ERRORS
box    *        virtualbox   Running   tcp://192.168.99.100

However the varlink says 'root@127.0.0.1'

>podman-machine env --varlink
SET VARLINK_BRIDGE=C:\WINDOWS\System32\OpenSSH\ssh.exe -F /dev/null -o ConnectionAttempts=3 -o ConnectTimeout=10 -o ControlMaster=no -o ControlPath=none -o LogLevel=quiet -o PasswordAuthentication=no -o ServerAliveInterval=60 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@127.0.0.1 -o IdentitiesOnly=yes -i C:\Users\Seriousme\.local\machine\machines\box\id_rsa -p 59450 varlink bridge
SET PODMAN_VARLINK_BRIDGE=$VARLINK_BRIDGE
REM Run this command to configure your shell:
REM     @FOR /f "tokens=*" %i IN ('podman-machine env --varlink') DO @%i

Is that ok ?

afbjorklund commented 5 years ago

It is needed to connect as root, if we want to access the socket directly.

For later versions (i.e. master) it will instead use “sudo varlink bridge” to gain privileges. Then the ssh connection can still happen as a non-root user. Same ssh keys are used for accessing both users.

seriousme commented 5 years ago

Ok, I tried to use the varlink bridge with root@192.168.99.100 but to no avail:

>podman images
Error: unable to get images: unexpected EOF
afbjorklund commented 5 years ago

Seems to work on Linux, haven't tested any recent version on Windows.

lareeth commented 5 years ago

@seriousme are you still having issues? I'm happy to offer support for podman and podman-machine on windows

seriousme commented 5 years ago

@lareeth Well, I basically lost interest. I thought it would just be a nice little puzzle to satisfy my curiosity. But podman-remote seems to have a different goal than boot2podman and thats fine too.

I was quite surprised to see a platform dependent SSH tunnel relying on native oppenssh binaries where I expected something like a platform independent REST API. I can see its easy if you don't want a daemon running server side, but in my view it shifts complexity and security to the client.

Anyways: thanks for the offer, but I'll pass for now.

Kind regards, Hans

afbjorklund commented 5 years ago

Supposedly there is a built-in go-native ssh client (if you don't have a ssh binary on your path), but I haven't verified it. But podman has taken the decision to use varlink (over ssh), rather than REST (over https). So that means that boot2podman will implement running a sshd server and offering a varlink resolver (and podman socket). Ironically that actually means running two servers... ☺️

Options:
  --native-ssh                      Use the native (Go-based) SSH implementation. [$MACHINE_NATIVE_SSH]

At least the basics seem to work, i.e. if I temporarily disable my /usr/bin/ssh:

$ which ssh
$ ssh
Programmet "ssh" är för närvarande inte installerat. Du kan installera det genom att ange:
sudo apt install openssh-client
$ podman-machine --native-ssh ssh
        .---.        b o o t 2                 mm             https://podman.io
       /o   o\                                 ##                              
    __(=  "  =)__    ##m###m    m####m    m###m##  ####m##m   m#####m  ##m####m
     //\'-=-'/\\     ##"  "##  ##"  "##  ##"  "##  ## ## ##   " mmm##  ##"   ##
        )   (        ##    ##  ##    ##  ##    ##  ## ## ##  m##"""##  ##    ##
       /     \       ###mm##"  "##mm##"  "##mm###  ## ## ##  ##mmm###  ##    ##
  ____/  / \  \____  ## """      """"      """ ""  "" "" ""   """" ""  ""    ""
 `------'`"`'------' ##                                                art: jgs
tc@box:~$ podman version
Version:            1.6.0-dev
RemoteAPI Version:  1
Go Version:         go1.12.10
OS/Arch:            linux/amd64
afbjorklund commented 5 years ago

Anyways: thanks for the offer, but I'll pass for now.

Sorry to hear, the end goal of the project is that it should something of a "Podman Toolbox"... i.e. should offer everything that is needed in order to run podman, both a client and a server

But that is still rather far from a full-featured "Podman for Windows" complete product offering. I guess that is something that will have to come from Red Hat, don't have the resources here.

lareeth commented 5 years ago

The issue is that Windows doesn't ship with an SSH client installed by default, which causes an issue, Which is why I made to contribution to include the link to SSH for Windows

Ideally podman ships with a varlink and ssh client built in, so you don't need anything else installed. Its mostly a Windows problem, as most linux users will have ssh installed, unlike Windows users.

afbjorklund commented 5 years ago

I would normally use the bash shell from Git for Windows, which comes with a ssh binary as well.

lareeth commented 5 years ago

Yeah, there are several options, Windows Subsystem for Linux also works too. But these are additional things that need to be installed.

afbjorklund commented 5 years ago

To help with the original problem, I added some binaries: https://github.com/boot2podman/libpod/releases/tag/v1.6.1

lareeth commented 5 years ago

I'm also maintaining these, I'm happy to donate

https://github.com/lareeth/choco-podman-machine https://chocolatey.org/packages/podman-machine

https://github.com/lareeth/choco-podman-cli https://chocolatey.org/packages/podman-cli/1.6.0

This contains all the windows binaries https://github.com/lareeth/podman-cli-builder

Chocolatey is a popular package manager for Windows

afbjorklund commented 5 years ago

Updated the readme, with some temporary binaries....

We could add more instructions, like chocolatey or brew, but I hope that upstream will have those ?

As in, hopefully one would just go to https://podman.io and click the large shiny "Download" button

Don't know what podman-cli is, sorry. (podman-remote?)

lareeth commented 5 years ago

podman-cli is just the podman-remote it follows the same naming convention as docker. As podman-remote is just the cli for a full podman install. Sorry for the confusion.

afbjorklund commented 5 years ago

I guessed it was following the docker convention, I just don't really like it :-)

i.e. dockerd is called "docker", so docker must be called "docker-cli" ? eww.

ooodigi commented 5 years ago

Thanks for adding the remote binaries to releases. However the macOS (darwin) file appears to be a .dms file. Me and my duck(duckgo) have no clue on how to open that file. Please consider providing a zip file.

afbjorklund commented 5 years ago

I don't know what a .dms file is, it was supposed to be an executable (raw, uncompressed, exe)

podman-remote-darwin:      Mach-O 64-bit x86_64 executable
podman-remote-linux:       ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped
podman-remote-windows.exe: PE32+ executable (console) x86-64 (stripped to external PDB), for MS Windows
seriousme commented 5 years ago

its a bug ;-)

DMS File Association 3 A file with a .dms extension is a file that has been downloaded and renamed by the Apple Safari web browser or the Apple Mail email client. It contains the contents of a file that did not have a file extension or was erroneously renamed when downloaded. The .dms extension is a result of a bug in Safari and Mail. https://fileinfo.com/extension/dms

lareeth commented 5 years ago

Have you guys tried the official binaries? https://console.cloud.google.com/storage/browser/libpod-master-releases?authuser=0&pli=1

afbjorklund commented 5 years ago

Basically it is just whatever go build produced, when doing a cross-compile. (with GOOS=darwin) There really should be a better way to distribute binaries, and it really should be at https://podman.io.

I personally like Zero Install, which has a lot of features over just using plain old binaries at GitHub. But I'm not sure anyone would use it anyway. For Mac, I hear there's something available with brew.

https://podman.io/getting-started/installation