Esempio n. 1
0
        static void Main(string[] args)
        {
            var vboxPath = Environment.GetEnvironmentVariable("VBOX_INSTALL_PATH");
            var machines = new List<string>();

            foreach(var item in args) {
                var m = Regex.Match(item, @"--vboxpath=(?<value>.+$)");
                if(m.Success)
                    vboxPath = m.Groups["value"].Value;
                else
                    machines.Add(item);
            }

            var bridge = new VirtualBoxBridge(vboxPath);
            var host = new VirtualBoxHostService(bridge);
            foreach (var item in machines)
                host.AddMachine(item);
            if (Environment.UserInteractive) {
                host.Start();
                Console.WriteLine("<press any key to stop host>");
                Console.ReadKey();
                host.Stop();
            } else {
                ServiceBase.Run(host);
            }
        }
Esempio n. 2
0
 public VirtualMachine(VirtualBoxBridge bridge, string nameOrId)
 {
     this.bridge = bridge;
     this.nameOrId = nameOrId;
     this.headlessProcess = VBoxHeadless(nameOrId);
 }
Esempio n. 3
0
 public VirtualBoxHostService(VirtualBoxBridge bridge)
 {
     this.bridge = bridge;
     Logger = new NullLogger();
 }