vboxwrapper: add <bridge_mode/> otion for bridged mode networking

This commit is contained in:
David Anderson 2014-08-18 20:33:51 -07:00
parent d21a062f89
commit c7aaf64423
3 changed files with 12 additions and 0 deletions

View File

@ -101,6 +101,7 @@ VBOX_VM::VBOX_VM() {
enable_remotedesktop = false;
register_only = false;
enable_network = false;
bridged_mode = false;
pf_guest_port = 0;
pf_host_port = 0;
headless = true;
@ -2394,6 +2395,14 @@ int VBOX_VM::set_network_access(bool enabled) {
retval = vbm_popen(command, output, "enable network");
if (retval) return retval;
if (bridged_mode) {
command = "modifyvm \"" + vm_name + "\" ";
command += "--nic1 bridged";
retval = vbm_popen(command, output, "set bridged mode");
if (retval) return retval;
}
} else {
fprintf(
stderr,

View File

@ -140,6 +140,8 @@ public:
// whether to add an extra cache disk for systems like uCernVM
bool enable_network;
// whether to allow network access
bool bridged_mode;
// use bridged mode for network
bool enable_shared_directory;
// whether to use shared directory infrastructure
bool enable_floppyio;

View File

@ -199,6 +199,7 @@ int parse_job_file(VBOX_VM& vm) {
else if (xp.parse_string("fraction_done_filename", vm.fraction_done_filename)) continue;
else if (xp.parse_bool("enable_cern_dataformat", vm.enable_cern_dataformat)) continue;
else if (xp.parse_bool("enable_network", vm.enable_network)) continue;
else if (xp.parse_bool("bridged_mode", vm.bridged_mode)) continue;
else if (xp.parse_bool("enable_shared_directory", vm.enable_shared_directory)) continue;
else if (xp.parse_bool("enable_floppyio", vm.enable_floppyio)) continue;
else if (xp.parse_bool("enable_cache_disk", vm.enable_cache_disk)) continue;