1

Environment presentation:

  1. I use VirtualBox
  2. Virtual Machine OS: Ubuntu 12.04 LTS
  3. Host Machine OS: Ubuntu 12.04 LTS.


    Problem:

    I run a program inside a VM which outputs 0 or 1 only: How can I communicate this result from the VM to my host machine (which is Ubuntu 12.04)
2
  • 1
    Guest OS? Where does your program output the result to?
    – Takkat
    Jun 28, 2014 at 10:41
  • I edited my question.
    – user284234
    Jun 30, 2014 at 6:34

1 Answer 1

0

VBoxManage

We can issue any application on the guest from the host with VBoxManage guestcontrol. There are several options to this command nicely documenetd in the above linked Virtual Box manual.

As an example we may issue:

VBoxManage -q guestcontrol "Name_of_VM" execute --image "full/path/to/application" --username <me> --passwordfile mypassword.txt --wait-exit --wait-stdout [<-- options>]

This may be a security issue as your guest user password needs to be given in an insecure password file on the host.

SSH

Somewhat easier than this, and in case we had set up SSH to our VM we can of course access the guest application through an SSH session. This is how I usually access guest applications.

ssh user@virualmachine application

You must log in to answer this question.