Exception threw during connect the VBoxWebSvr

Discussions related to using VirtualBox on Windows hosts.
Post Reply
zzm
Posts: 1
Joined: 28. Oct 2011, 11:11
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Ubuntu

Exception threw during connect the VBoxWebSvr

Post 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?
dcod
Posts: 8
Joined: 12. Jan 2012, 14:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: linux

Re: Exception threw during connect the VBoxWebSvr

Post 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
shrikane
Posts: 17
Joined: 12. Mar 2015, 01:40

Re: Exception threw during connect the VBoxWebSvr

Post 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
Post Reply