public boolean init() {
		this.manager = VirtualBoxManager.createInstance(null);
		try {
			this.manager.connect(this.webserviceUrl, username, password);
		} catch (VBoxException e) {
			LOGGER.error(
					"Could not connect to virtual box manager, start webserver fist",
					e);
			return false;
		}

		this.virtualBox = this.manager.getVBox();
		if (this.machineName != null) {
			for (IMachine machine : this.virtualBox.getMachines()) {
				if (this.machineName.equals(machine.getName())) {
					this.machine = machine;
					break;
				}
			}
		} else {
			LOGGER.debug("No Machine name given. Picking first VM");
			this.machine = this.virtualBox.getMachines().get(0);
		}

		if (this.machine == null) {
			throw new IllegalStateException("Machine " + this.machineName
					+ " not found");
		}

		this.session = this.manager.getSessionObject();
		if (this.machine.getState().equals(MachineState.Running)
				|| this.machine.getState().equals(MachineState.Paused)) {
			this.machine.launchVMProcess(this.manager.getSessionObject(),
					"emergencystop", null);
		}
		IProgress progress = this.machine.launchVMProcess(this.session, "gui",
				"");
		progress.waitForCompletion(30000);
		if (progress.getResultCode() != 0) {// check success
			LOGGER.error("could not launch virtual machine");
			return false;
		}

		try {
			Thread.sleep(30000);
		} catch (InterruptedException e) {
		}

		this.console = this.session.getConsole();

		this.keyboardEventThread = new KeyboardEventThread(this.console);
		this.keyboardEventThread.start();

		this.mouseEventThread = new MouseEventThread(this.console);
		this.mouseEventThread.start();
		this.keyboard = this.console.getKeyboard();
		this.mouse = this.console.getMouse();

		this.keepAwake = new KeepAwake(this.session);
		this.keepAwake.start();
		return true;
	}