VirtualBox

Opened 7 years ago

Closed 6 years ago

#17386 closed defect (fixed)

guestcontrol run with --wait-stdout will not return -> fixed in 5.2.20

Reported by: Quizzles Owned by: pentagonik
Component: guest control Version: VirtualBox 5.2.4
Keywords: Cc:
Guest type: Linux Host type: Windows

Description

Hello there,

After updating VirtualBox from 5.1.30 to 5.2.4 the following command will not return after executing.

C:\Program Files\Oracle\VirtualBox>VBoxManage.exe --nologo guestcontrol Fedora24_32Bit run --verbose --wait-stdout --username testuser --wait-stderr --exe /bin/pwd Creating guest session as user 'testuser'... Waiting for guest session to start... Successfully started guest session (ID 1) Starting guest process ... Process '/bin/pwd' (PID 1637) started

The process on the guest system will be executed and terminated. But the VBoxManage on the host system will not return and print no output from the guest.

If trying to execute a not existing program the VBoxManage will return. C:\Program Files\Oracle\VirtualBox>VBoxManage.exe --nologo guestcontrol Fedora24_32Bit run --verbose --wait-stdout --username testuser --wait-stderr --exe /bin/not_exist Creating guest session as user 'testuser'... Waiting for guest session to start... Successfully started guest session (ID 1) Starting guest process ... VBoxManage.exe: error: The specified file was not found on guest VBoxManage.exe: error: Details: code VBOX_E_IPRT_ERROR (0x80bb0005), component GuestProcessWrap, interface IGuestProcess, callee IUnknown VBoxManage.exe: error: Context: "WaitForArray(ComSafeArrayAsInParam(aWaitStartFlags), gctlRunGetRemainingTime(msStart, cMsTimeout), &waitResult)" at line 1529 of file VBoxManageGuestCtrl.cpp Closing guest session ...

Thank you for your help!

Change History (19)

comment:1 by delx, 7 years ago

Last edited 7 years ago by delx (previous) (diff)

comment:2 by delx, 7 years ago

I'm experiencing the same problem. The host is running Debian Stretch while the Guest is running Windows 8. I'm using VirtualBox version 5.2.8-121009~Debian~stretch.

I'm running the command as follows: sudo -u user VBoxManage guestcontrol vmName run --username user --password testtest -- C:\folder\command.exe arg1 arg2 arg2

Normally the command produces some output, but I don't see any output. It just hangs forever. Because the command creates some files, I know that the command ran on the guest.

Because of this bug the guestcontrol run-functionality in VirtualBox 5.2 is unusable, because the command never returns. On 5.1 it worked fine.

comment:3 by pentagonik, 7 years ago

Owner: set to pentagonik
Status: newassigned

comment:4 by pentagonik, 7 years ago

Looks like something broke -- it really shouldn't hang. I'll have a look.

comment:5 by delx, 7 years ago

Great, thanks a lot. Let me know if you need further information.

comment:6 by delx, 7 years ago

When I just switched back to VirtualBox 5.1.34, I forgot to also downgrade the Windows 8 guest additions. Thus my Windows 8 guest still ran the VirtualBox 5.2.8 guest additions. Interestingly, I experienced the same bug: guestcontrol run didn't produce any output and it was hanging while the command had been executed on the guest, since I saw the command's output files.

Could it be a bug of the VirtualBox Guest Additions for Windows?

comment:7 by delx, 7 years ago

The bug also happened with VirtualBox 5.1.34 on the host (Debian Stretch) and the Guest Additions 5.1.34 on the guest (Windows 8).

It does not happen always, but sometimes.

Last edited 7 years ago by delx (previous) (diff)

comment:8 by mskov, 6 years ago

We are also experiencing the same issue. Guest execution on a Linux guest with reading of stdout or stderr is simply not possible any longer. We tried VBox 5.2.12/5.2.14 and GAs 5.2.12/5.2.14. We tried Debian 8 and Ubuntu 18.04 guests (Windows 10 host). Guest execution always hangs as long as you provide --wait-stdout or --wait-stderr flag (or simply omit a "--no-wait-stdout" or "--no-wait-stderr" flag).

C:\Users\kovalev>vboxmanage guestcontrol BitBox run --verbose --username root --password keins --exe /bin/ls --wait-stdout --wait-stderr
Creating guest session as user 'root'...
Waiting for guest session to start...
Successfully started guest session (ID 11)
Starting guest process ...
Process '/bin/ls' (PID 1143) started

It works fine if no waiting for stdout/stderr is performed:

C:\Users\kovalev>vboxmanage guestcontrol BitBox run --verbose --username root --password keins --exe /bin/ls --no-wait-stdout --no-wait-stderr
Creating guest session as user 'root'...
Waiting for guest session to start...
Successfully started guest session (ID 10)
Starting guest process ...
Process '/bin/ls' (PID 1131) started
Process terminated
Exit code=0 (Status=500 [successfully terminated])
Closing guest session ...

We don't have any issues with GAs 5.1.32 (both with VBox 5.1.32 and VBox 5.2.12). So it must be a problem of the 5.2.X guest additions.

comment:9 by CADBOT, 6 years ago

I'm also having this bug on Centos 7 with GA 5.2.x

comment:10 by pentagonik, 6 years ago

I've just reproduced the issue with VBox 5.2.18 + Guest Additions 5.2.18 and having a fix for it. I'll let you know as soon as there's a new (public) test build with the fix available.

comment:11 by pentagonik, 6 years ago

The 5.2 test build 124553 is available here. Please let me know if this fixes the issue for you. Thank you!

in reply to:  11 comment:12 by Socratis, 6 years ago

Replying to pentagonik:

test build 124553... if this fixes the issue

It doesn't on an OSX 10.11.6 host with a Fedora 25 guest. The following gets... stuck:

VBoxManage guestcontrol Fedora --verbose --username socratis --password PASSWORD run --exe /bin/whoami
Creating guest session as user 'socratis'...
Waiting for guest session to start...
Successfully started guest session (ID 4)
Starting guest process ...
Process '/bin/whoami' (PID 2522) started

It fails without the "--wait-stdout --wait-stderr" as well.

In the guest, "ps -aux" looks like:

USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
socratis  2518  0.0  0.1  90416  2512 ?        Sl   19:15   0:00 /opt/VBoxGuestAdditions-5.2.19/sbin/VBoxService guestsession --session-id=4 --session-proto=2 --user socratis

One thing that I don't understand is that why the VBoxManage shows a PID of 2522, while from the guest I see 2518...

comment:13 by pentagonik, 6 years ago

Did you upgrade the Guest Additions to 124533 as well? Additionally, a guest reboot is necessary. This is needed in order to make the fix working.

Last edited 6 years ago by pentagonik (previous) (diff)

in reply to:  13 comment:14 by Socratis, 6 years ago

Replying to pentagonik:

Did you upgrade the Guest Additions to 124533 as well? This is needed in order to make the fix working.

Andreas, I'm ... offended! :D

Of course I updated the GAs (that's where I suspected that the problem originated from, to begin with). But, the question is, did you update the GAs in the package? Because the VirtualBox may be build 124533, but from the log and the CLI (in the guest) the GAs are shown as 124323, which is 4 builds younger than the 5.2.18 release, and 210 builds older than the main VirtualBox module:

00:00:10.083335 VMMDev: Guest Additions information report: Version 5.2.19 r124323 '5.2.19'
socratis@VB-Mint ~ $ VBoxClient --version
5.2.19r124323

Downloading the 124533 GAs ISO separately seems to confirm that the issue is fixed. This time I tested with a Mint (17) guest:

$ VBoxManage guestcontrol Mint --verbose --username socratis --password PASSWORD run --exe /usr/bin/whoami --wait-stdout --wait-stderr
Creating guest session as user 'socratis'...
Waiting for guest session to start...
Successfully started guest session (ID 1)
Starting guest process ...
Process '/usr/bin/whoami' (PID 2448) started
socratis
Process terminated
Exit code=0 (Status=500 [successfully terminated])
Closing guest session ...

\o/

comment:15 by pentagonik, 6 years ago

Ah nice, yeah, might be a package inconsistency -- thanks for verifying!

@mskov Does this also solve the issue for you?

comment:16 by Klaus Espenlaub, 6 years ago

It's rarely this extreme, but since our automated build system only does GA builds if some relevant code has changed it can happen. Our test builds (creating the normal packages) include the latest already available GA build and the GA build takes quite long. So the chance is high that for GA changes the new packages contain old GA.

comment:17 by Socratis, 6 years ago

The latest test builds (r124624) contain the r124533 GAs, so you could simply download the latest Test build, without the need to download the GAs ISO separately.

Lesson learned? Always check the GAs version bundled with the test builds, they might be out of sync. ;)

comment:18 by mskov, 6 years ago

I can also confirm that the problem is solved with the GAs r124533. Thank you very much!

comment:19 by Michael Thayer, 6 years ago

Resolution: fixed
Status: assignedclosed
Summary: guestcontrol run with --wait-stdout will not returnguestcontrol run with --wait-stdout will not return -> fixed in 5.2.20
Note: See TracTickets for help on using tickets.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette