This might already been answered before but that was regarding unicode and I don't think this is unicode (it's in ASCII so...).
When I execute this in my terminal there is no problem what so ever
vboxmanage setextradata "Test Machine" "VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" 2222
However when I use the following in Java
Runtime.getRuntime().exec("vboxmanage setextradata \"Test Machine\" \"VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort\" 2222");
It returns an error: unregistered vm '"TestMachine"'
The same goes for parameters with spaces in them like Test\ Machine, then it doesn't escape the space.
Now I think this has something to do with the character encoding, but I don't see any option to set that o_O
ProcessBuilder
on how to specify arguments to a program. – CartridgeTestMachine
need to be in quotes or escaped? – Jimmyjimsonweed