mirror of
https://github.com/GNS3/gns3-server
synced 2025-01-11 16:41:04 +00:00
Use the correct VirtualBox host-only type
This commit is contained in:
parent
c6d6fcfe66
commit
e45467af57
@ -231,16 +231,17 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
|
|||||||
raise GNS3VMError('VM "{}" must have a NAT interface configured in order to start'.format(self.vmname))
|
raise GNS3VMError('VM "{}" must have a NAT interface configured in order to start'.format(self.vmname))
|
||||||
|
|
||||||
if sys.platform.startswith("darwin") and parse_version(self._system_properties["API version"]) >= parse_version("7_0"):
|
if sys.platform.startswith("darwin") and parse_version(self._system_properties["API version"]) >= parse_version("7_0"):
|
||||||
|
# VirtualBox 7.0+ on macOS requires a host-only network interface
|
||||||
backend_type = "hostonly-network"
|
backend_type = "hostonly-network"
|
||||||
backend_description = "host-only network"
|
backend_description = "host-only network"
|
||||||
vboxnet_type = "hostonlyifs"
|
vboxnet_type = "hostonlynets"
|
||||||
interface_number = await self._look_for_interface("hostonlynetwork")
|
interface_number = await self._look_for_interface("hostonlynetwork")
|
||||||
if interface_number < 0:
|
if interface_number < 0:
|
||||||
raise GNS3VMError('VM "{}" must have a network adapter attached to a host-only network in order to start'.format(self.vmname))
|
raise GNS3VMError('VM "{}" must have a network adapter attached to a host-only network in order to start'.format(self.vmname))
|
||||||
else:
|
else:
|
||||||
backend_type = "hostonlyadapter"
|
backend_type = "hostonlyadapter"
|
||||||
backend_description = "host-only adapter"
|
backend_description = "host-only adapter"
|
||||||
vboxnet_type = "hostonlynets"
|
vboxnet_type = "hostonlyifs"
|
||||||
interface_number = await self._look_for_interface("hostonly")
|
interface_number = await self._look_for_interface("hostonly")
|
||||||
|
|
||||||
if interface_number < 0:
|
if interface_number < 0:
|
||||||
@ -264,7 +265,7 @@ class VirtualBoxGNS3VM(BaseGNS3VM):
|
|||||||
interface_number,
|
interface_number,
|
||||||
self._vmname))
|
self._vmname))
|
||||||
|
|
||||||
if not (await self._check_dhcp_server(vboxnet)):
|
if backend_type == "hostonlyadapter" and not (await self._check_dhcp_server(vboxnet)):
|
||||||
raise GNS3VMError('DHCP must be enabled on VirtualBox host-only network "{}"'.format(vboxnet))
|
raise GNS3VMError('DHCP must be enabled on VirtualBox host-only network "{}"'.format(vboxnet))
|
||||||
|
|
||||||
vm_state = await self._get_state()
|
vm_state = await self._get_state()
|
||||||
|
Loading…
Reference in New Issue
Block a user