Oleg Sivokon <[email protected]> writes:

> Hello,

Hi Oleg,

> I was trying to access filesystem inside a Docker container running
> inside a virtual machine (VMWare, in a VCenter).  My host OS is Fedora
> 23.  The VM OS is CentOS 7, the Docker container system is CentOS 7 too.
>
> I've used `docker-tramp' library to add a connection type for Docker
> containers.  (However, I also tried to do that on my own earlier).  The
> relevant code looks like this:
>
> (add-to-list 'tramp-methods
>              '("docker"
>                (tramp-login-program "docker")
>                (tramp-login-args
>                 (("exec" "-i") ("%h") ("/bin/sh")))
>                (tramp-remote-shell "/bin/sh")
>                (tramp-remote-shell-args ("-i") ("-c"))))

With this setting, I couldn't connect to docker.

> I've also tried `(tramp-login-args (("exec" "-ti") ("%h") ("/bin/sh")))'

With this, I could.

> Even though I am able to use Tramp to ssh into this VM, and I can use
> Tramp inside Docker container running on my system, I cannot connect to
> the docker running inside a VM using /ssh:vm|docker:id:/ path.  The
> output seems to indicate there is a problem with carriage returns (^M)
> which might mess up the parsing.

That's correct. The traces tell us, that ^M is not suppressed. That's
because of your following settings:

--8<---------------cut here---------------start------------->8---
12:24:57.479493 tramp-send-command (6) # stty -a
12:24:57.484857 tramp-wait-for-regexp (6) # 
speed 38400 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd -cmspar cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
///c92423c4fd16f4857a1b9d765f804f3e#$
--8<---------------cut here---------------end--------------->8---

In my test, the traces look like this:

--8<---------------cut here---------------start------------->8---
11:37:53.505839 tramp-send-command (6) # stty -a
11:37:53.556796 tramp-wait-for-regexp (6) # 
speed 38400 baud; rows 0; columns 0; line = 0;
intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;
-parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts
-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff
-iuclc -ixany -imaxbel iutf8
opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0
isig icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke
///fcbf55471f8b782a7987feec93cc598e#$
--8<---------------cut here---------------end--------------->8---

The relevant difference is onlcr (your case) and -onlcr (my case). Well,
there was a problem in Tramp indeed, missing this setting. This is
fixed already in Tramp, the next Emacs 25.1 won't suffer from this
problem.

You could try the pretest version of Emacs 25.1. If you don't want to
install it locally, you could install the latest stable Tramp 2.2.13,
which has fixed this as well.

Best regards, Michael.

_______________________________________________
Tramp-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/tramp-devel

Reply via email to