標題: Collection of VirtualBox commands via command line interface [打印本頁] 作者: 角色 時間: 2018-2-28 18:46 標題: Collection of VirtualBox commands via command line interface
The VirtualBox GUI allows you to create 4 interfaces in maximum. In order to create another four interfaces, you need to have the following commands:
Create another 7 interfaces
VBoxManage modifyvm R4 --nic5 intnet
VBoxManage modifyvm R4 --nic6 intnet
VBoxManage modifyvm R4 --nic7 intnet
VBoxManage modifyvm R4 --nic8 intnet
複製代碼
where R4 is the vm name. If the vm name has space in between, then you have to use "", for example "RouterOS 1". "intnet" is the name of "internal network". The internal network may be thought as a hub which connect each device. In general, there are only two device connected to this internal network. This internal network may become a Ethernet cable connecting the two devices.
Delete one interface
VBoxManage modifyvm R4 --nic3 none
複製代碼
作者: 角色 時間: 2018-2-28 18:47
本帖最後由 角色 於 2018-2-28 19:34 編輯
Show the properties of Router (R4)
VBoxManage showvminfo R4
複製代碼
作者: 角色 時間: 2018-2-28 18:47
本帖最後由 角色 於 2018-2-28 23:22 編輯
Change (setup) the interface type (e.g, Internal network designed by intnet)
VBoxManage modifyvm R4 --nic2 intnet
複製代碼
#
Define the internal network "network name" (e.g. Cable X)
VBoxManage modifyvm R4 --intnet2 CableX
複製代碼
#
Set the interface as a bridged adaptor
VBoxManage modifyvm SW1 --nic1 bridged
複製代碼
The above command to set the SW1 NIC 1 as a bridged adaptor to the host network.#
Disconnect the cable between the virtual machine and network