private void Button7_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(currentMachineName)) { MessageBox.Show("choose machine name first"); return; } VirtualBox.IVirtualBox vb = new VirtualBox.VirtualBoxClass(); var mc = vb.FindMachine(currentMachineName); session = new VirtualBox.SessionClass(); machine = mc; UpdateSnapshots(mc); }
private void button2_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(currentMachineName)) { MessageBox.Show("choose machine name first"); return; } VirtualBox.IVirtualBox vb = new VirtualBox.VirtualBoxClass(); var mc = vb.FindMachine(currentMachineName); session = new VirtualBox.SessionClass(); //s.UnlockMachine(); var ret = mc.LaunchVMProcess(session, "gui", ""); }
private void button4_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(currentMachineName)) { MessageBox.Show("choose machine name first"); return; } VirtualBox.IVirtualBox vb = new VirtualBox.VirtualBoxClass(); var mc = vb.FindMachine(currentMachineName); if (mc.State != MachineState.MachineState_Running) { MessageBox.Show("run machine first"); return; } session = new VirtualBox.SessionClass(); //s.UnlockMachine(); machine = mc; mc.LockMachine(session, VirtualBox.LockType.LockType_Shared); UpdateSnapshots(mc); }