If I do this line by line I get the same result. All I need to do to resolve the issue is click Settings then click OK but I shouldn't have to do that.VBoxManage createvm --name "$MACHINE" --ostype "$TYPE" --register --basefolder "$VMHOME"
VBoxManage modifyvm "$MACHINE" --ioapic on --cpus 6 --memory $RAM --vram 128 --graphicscontroller vmsvga --nic1 nat
VBoxManage createhd --filename "$VMHOME/$MACHINE/$MACHINE"_DISK.vdi --size $SPACE --format VDI
VBoxManage storagectl "$MACHINE" --name "SATA Controller" --add sata --controller IntelAhci
VBoxManage storageattach "$MACHINE" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "$VMHOME/$MACHINE/$MACHINE"_DISK.vdi
VBoxManage storagectl "$MACHINE" --name "IDE Controller" --add ide --controller PIIX4
VBoxManage storageattach "$MACHINE" --storagectl "IDE Controller" --port 1 --device 0 --type dvddrive --medium "$ISO"
VBoxManage modifyvm "$MACHINE" --boot1 dvd --boot2 disk --boot3 none --boot4 none
VBoxManage modifyvm "$MACHINE" --nic1 bridged
VBoxHeadless --startvm "$MACHINE"
Bridged NIC Name Not Set During Command Line Creation
Bridged NIC Name Not Set During Command Line Creation
When I create a vm using the gui, everything works fine. When I use a script I wrote, the nic values aren't set properly. Everything is set except for the name. I'm using --nic1 bridged and that sets properly but I have to go into the gui, open settings and then click OK for the name (that is already there) to be assigned (enp4s0). I've tried setting the nic to nat and then change it to bridged but that doesn't resolve the issue.
- Attachments
-
- Screenshot from 2021-10-03 17-52-03.png (36.08 KiB) Viewed 1713 times
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Bridged NIC Name Not Set During Command Line Creation
There is another command to be used after 'modifyvm nic# bridged':
I think --bridgeadapter# has to be the same # as nic#.VBoxManage modifyvm "$MACHINE" --bridgeadapter<1-N> none|<devicename>
Only has an effect if bridged networking has been enabled for a virtual network card. Use this option to specify which host interface the given virtual network interface will use.
Re: Bridged NIC Name Not Set During Command Line Creation
That did it.
Is there a way to mark this "solved"? VBoxManage modifyvm "Fedora Server 35" --nic1 bridged --bridgeadapter1 enp4s0
Is there a way to mark this "solved"? VBoxManage modifyvm "Fedora Server 35" --nic1 bridged --bridgeadapter1 enp4s0
-
- Site Moderator
- Posts: 20945
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Bridged NIC Name Not Set During Command Line Creation
Excellent! Glad you're up and running.
No need to mark solved, that's just fine.
No need to mark solved, that's just fine.