diff --git a/net.go b/net.go index 95180eb..a765020 100644 --- a/net.go +++ b/net.go @@ -210,6 +210,9 @@ func (vb *VBox) AddNic(vm *VirtualMachine, nic *NIC) error { } args = append(args, fmt.Sprintf("--nictype%d", nic.Index), string(nic.Type)) + if nic.MAC != "" { + args = append(args, fmt.Sprintf("--macaddress%d", nic.Index), nic.MAC) + } _, err := vb.modify(vm, args...) return err diff --git a/types.go b/types.go index ceec014..39f36ff 100644 --- a/types.go +++ b/types.go @@ -100,7 +100,7 @@ type NIC struct { Speedkbps int BootPrio int PromiscuousMode string - MAC string //auto assigns mac automatically + MAC string } type Network struct {