I've been using Virtualbox for a while now, but the only way I've learned to interact with it is through the graphical interface.Is there a way for me to send bash commands to the vm through the commandline so that I can write scripts from the host that interact with the guest?e.g.$ sendMessage vmName echo helloI am willing to try new virtualization software.I am currently on a Mac and I would like to run a Linux guest this way.Edit:I want to run possibly malicious code to see its behavior. Ideally, I want to disable networking on the guest so that I can be sure the guest is completely isolated.I was hoping the guest and the host could communicate purely through stdin/stdout.
Command line friendly virtual machine
linux;osx;virtualbox;virtual machine
Using shared filesystemsYou can use VirtualBox's support for exposting a host directory within the guest.  Put the code you want to test inside your shared directly, boot the VM, and use the console to navigate to the shared directory and run the code.  You don't need any networking, the exposure to your host is only in that one shared directory, and you can use snapshots to revert any changes to the guest filesystem.Using a virtual serial portYou can configure a guest serial port so that you can interact with the guest from the host without any networking configured.In VirtualBox, go to Settings -> Ports, enable the first serial port, and set the port mode to Host Pipe (and make sure Create Pipe is checked).  Enter a path in the appropriate field (e.g., /tmp/hostserial).  This path is the Unix socket that will be exposed on your host.Boot your guest.  Now your job is to get something inside the guest talking to the seiral port.  Try this:agetty -l /bin/bash -n ttyS0 115200 vt100This will start up a bash shell on ttyS0, the first serial port.  On your OS X host, make sure you have netcat installed and try this:nc -U /tmp/hostserialYou'll find yourself talking to bash on your guest.  This isn't exactly what you want, but maybe it's helpful anyway.I'd go with the first option using a shared directory, myself.