Skip to content
This repository has been archived by the owner on Apr 28, 2018. It is now read-only.

Interactivity to container doesn't work for named pipe connections #120

Open
swernli opened this issue Aug 2, 2016 · 10 comments
Open

Interactivity to container doesn't work for named pipe connections #120

swernli opened this issue Aug 2, 2016 · 10 comments
Assignees
Labels

Comments

@swernli
Copy link
Contributor

swernli commented Aug 2, 2016

When using any of the cmdlets that provide an interactive session with the container (Enter-ContainerSession, Run-ContainerImage, Exec-Container), the resulting session will work fine when connected to the daemon by tcp or unix socket, but fails to accept input and hangs when connected via named pipe. Still not sure why, investigation ongoing...

@swernli swernli self-assigned this Aug 2, 2016
@bgelens
Copy link

bgelens commented Aug 9, 2016

I experience this as well. Currently the easiest way (IMO) to interact with the container is to create a PowerShell direct session after the container is started.

$container = Invoke-ContainerImage -Detach -Isolation HyperV -Image $image -PassThru
Enter-PSSession -ContainerId $container.ID -RunAsAdministrator

@Jaykul
Copy link

Jaykul commented Aug 18, 2016

@bgelens What if the host is Windows, and the container is Linux?

@bgelens
Copy link

bgelens commented Aug 18, 2016

@Jaykul in that case I would fall back to docker cli for the moment. Although the new LIS version has added Hyper-V socket support (theoretically, we could attach over VM Bus as well)

@swernli
Copy link
Contributor Author

swernli commented Aug 18, 2016

@Jaykul I realize now the issue is ambiguously phrased... At the moment these cmdlets run on Windows host only, so the scenario I'm referring to is exactly that: when pointed at a Linux daemon, interactivity works fine, but when pointed at a Windows docker daemon output is displayed but input hangs. I'll update the title to clarify.

If you use the cmdlets to manage a Linux daemon things should work fine.

@swernli swernli changed the title Interactivity to container works in Linux, fails on Windows Interactivity to container works for Linux containers, fails if container is running Windows Aug 18, 2016
@friism
Copy link

friism commented Aug 18, 2016

@swernli hm, interactivity doesn't work me. Eg.:

Invoke-ContainerImage debian -Input -Terminal -Command bash

...starts the container and presents Debian/bash prompt, but just hangs and doesn't accept input. Am I doing it wrong?

@swernli
Copy link
Contributor Author

swernli commented Aug 18, 2016

That's very strange... it works for me:
PS S:\> Run-ContainerImage debian -Input -Terminal bash
root@de11d73b09ee:/# ls
bin dev home lib64 mnt proc run srv tmp var
boot etc lib media opt root sbin sys usr
root@de11d73b09ee:/# echo works!
works!
root@de11d73b09ee:/# exit
exit
PS S:\>

But the hanging at input is exactly what I see when using a Windows container. Where is your daemon running? Perhaps there is something different about the connections we are using...

@friism
Copy link

friism commented Aug 18, 2016

@swernli it's running in Docker for Windows. Tested from powershell

@swernli
Copy link
Contributor Author

swernli commented Aug 18, 2016

Ah, that could be the difference... I'm not sure what transport Docker for Windows uses. I've actually never used Docker for Windows myself; I'm testing this by connecting to an Ubuntu VM that I've set up manually as a docker host. Do you know what communication mechanism is used by the VM that Docker for Windows creates?

@friism
Copy link

friism commented Aug 18, 2016

@swernli named pipe over Hyper-V socket

@swernli
Copy link
Contributor Author

swernli commented Aug 18, 2016

Yeah, then this is likely the same issue that's affecting Windows containers, as those use named pipe as well. This is sounding like a generic named pipe issue, so I'll update the title and description to make clear that it tracks both problems. Hopefully I can find a solution soon...

@swernli swernli changed the title Interactivity to container works for Linux containers, fails if container is running Windows Interactivity to container doesn't work for named pipe connections Aug 18, 2016
@jterry75 jterry75 added the bug label Aug 18, 2016
@swernli swernli assigned jstarks and unassigned swernli Oct 22, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

6 participants