Page 1 of 1

Exception threw during connect the VBoxWebSvr

Posted: 28. Oct 2011, 11:23
by zzm
I try to connect the VBox to manage the VBox by usingJava SOAP API.
My VBox and VBox SDK I use is version is 4.1.4.
But the Exception I can't understand threw in connecting VBoxWebSrv.

Code: Select all

org.virtualbox_4_1.VBoxException: reasonText argument for createFault was passed NULL
	at org.virtualbox_4_1.VirtualBoxManager.connect(VirtualBoxManager.java:181)
	at vbox.test.TestVBoxMgr.main(TestVBoxMgr.java:21)
The TestVBoxMgr.java is the same as the example of SDK references.

Code: Select all

package vbox.test;

import org.virtualbox_4_1.IVirtualBox;
import org.virtualbox_4_1.VBoxException;
import org.virtualbox_4_1.VirtualBoxManager;

public class TestVBoxMgr {
	public static void main(String[] args) {

		VirtualBoxManager mgr = VirtualBoxManager.createInstance(null);
		boolean ws = true; // or true, if we need the SOAP version
		if (ws) {
			String url = "http://127.0.0.1:18083";
			String user = "test";
			String passwd = "test";
			try {
				mgr.connect(url, user, passwd);
			} catch(VBoxException e) {
				e.printStackTrace();
			}
		}
		IVirtualBox vbox = mgr.getVBox();
		System.out.println("VirtualBox version: " + vbox.getVersion() + "\n");
		// get first VM name
		String m = vbox.getMachines().get(0).getName();
		System.out.println("\nAttempting to start VM ’" + m + "’");
		// start it
		// mgr.startVm(m, null, 7000);
		if (ws)
			mgr.disconnect();
		mgr.cleanup();

	}

}

Could anyone help me?

Re: Exception threw during connect the VBoxWebSvr

Posted: 17. Jan 2012, 12:16
by dcod
Not sure if you are still having problems but I've found that it's caused by authentication.

The following command switches off authentication, for VirtualBox, and the connection completes.
VBoxManage setproperty websrvauthlibrary null
dcod

Re: Exception threw during connect the VBoxWebSvr

Posted: 12. Mar 2015, 01:45
by shrikane
if it helps somebody, I also got the same issue, but the username and password is not 'vbox' and 'pass' or 'test' and 'test' , but it is actually your machine credentials with which you started 'vboxwebsrv.exe' process.
so in my case it was login user name and password that I used to start my windows