[SOLVED] Add Custom Virtual NIC Device in VM Container

DonMcCoy

Active Member
Jun 18, 2017
7
0
41
33
Hello, I have a specified system image for telephone system, I could run everything without problem, but unfortunately i got "NIC Unavailable" Error at the host application, and upon searching, I discovered that this telephony application only have few driver support for network nic card, they are:

AMD NIC: Am79C970A PCnet-PCI II Single-Chip Full-Duplex Ethernet Controller
  • a.k.a PCNet32
  • a.k.a Vlance

And with Proxmox I have only the following model:

upload_2017-7-4_9-3-12.png


How could i add my own Virtual Nic, e.g. Vlance?

Any Idea is highly appreciated, Thanks
 
This is possible by editing the config from the command line (pc net is very old, I see it is recommended for the virtualization of Windows 3.1 ... )


For this:
find out the config file of your VM like /etc/pve/qemu-server/505.conf
remove the existing net0 device if any
add the following lines:
args: -net nic,model=pcnet
balloon: 0

now boot the VM you will a PCnet32 device inside:
root@stretch:~# lspci -k | sed -n '/Ethernet/,/Kernel modules/p'
00:03.0 Ethernet controller: Advanced Micro Devices, Inc. [AMD] 79c970 [PCnet32 LANCE] (rev 10)
Kernel driver in use: pcnet32
Kernel modules: pcnet32
 
  • Like
Reactions: DonMcCoy
Thanks for your reply and time.

However, I already did this, I edited my_vm.conf,
Added the line:
net0: Vlance=00:0C:29:10:28:A4,bridge=vmbr2
Instead of:
net0: vmxnet3=00:0C:29:10:28:A4,bridge=vmbr2

But then when i go to proxmox gui, I see that the whole network interface disappears, as i think i added an unavailable NIC in the conf.


And Now I tried with args as you said, This is my conf file:

Code:
boot: c
bootdisk: ide0
cores: 1
hotplug: disk,network
ide0: volume-fra1-01:101/vm-101-disk-1.qcow2,size=563M
ide1: volume-fra1-01:101/vm-101-disk-2.qcow2,size=1G
ide2: volume-fra1-01:101/vm-101-disk-3.qcow2,size=102M
ide3: volume-fra1-01:101/vm-101-disk-4.qcow2,size=307M
kvm: 0
memory: 200
name: IPVA
args: -net nic,model=pcnet
numa: 0
onboot: 1
ostype: other
smbios1: uuid=564df90a-32fe-3ddd-54e0-0a16da1028a4,manufacturer=564df90a-32fe-3ddd-54e0-0a16da1028a4
sockets: 1
tablet: 0


Now i fail to boot/start with the following error:

Code:
kvm: -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3: PCI: slot 3 function 0 not available for virtio-balloon-pci, in use by pcnet

And second line:
Code:
TASK ERROR: start failed: command '/usr/bin/kvm -id 101 -chardev 'socket,id=qmp,path=/var/run/qemu-server/101.qmp,server,nowait' -mon 'chardev=qmp,mode=control' -pidfile /var/run/qemu-server/101.pid -daemonize -smbios 'type=1,uuid=564df90a-32fe-3ddd-54e0-0a16da1028a4,manufacturer=564df90a-32fe-3ddd-54e0-0a16da1028a4' -name IPVA -smp '1,sockets=1,cores=1,maxcpus=1' -nodefaults -boot 'menu=on,strict=on,reboot-timeout=1000,splash=/usr/share/qemu-server/bootsplash.jpg' -vga cirrus -vnc unix:/var/run/qemu-server/101.vnc,x509,password -cpu qemu64 -m 200 -k en-us -net 'nic,model=pcnet' -device 'pci-bridge,id=pci.1,chassis_nr=1,bus=pci.0,addr=0x1e' -device 'pci-bridge,id=pci.2,chassis_nr=2,bus=pci.0,addr=0x1f' -device 'piix3-usb-uhci,id=uhci,bus=pci.0,addr=0x1.0x2' -device 'virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3' -iscsi 'initiator-name=iqn.1993-08.org.debian:01:60f978fdcfc' -drive 'file=/mnt/volume-fra1-01/images/101/vm-101-disk-1.qcow2,if=none,id=drive-ide0,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.0,unit=0,drive=drive-ide0,id=ide0,bootindex=100' -drive 'file=/mnt/volume-fra1-01/images/101/vm-101-disk-2.qcow2,if=none,id=drive-ide1,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.0,unit=1,drive=drive-ide1,id=ide1' -drive 'file=/mnt/volume-fra1-01/images/101/vm-101-disk-3.qcow2,if=none,id=drive-ide2,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.1,unit=0,drive=drive-ide2,id=ide2' -drive 'file=/mnt/volume-fra1-01/images/101/vm-101-disk-4.qcow2,if=none,id=drive-ide3,format=qcow2,cache=none,aio=native,detect-zeroes=on' -device 'ide-hd,bus=ide.1,unit=1,drive=drive-ide3,id=ide3' -machine 'accel=tcg'' failed: exit code 1
 
this is why you also need
balloon: 0
in your vm.conf as I wrote
 
  • Like
Reactions: DonMcCoy
sorry i missed the balloon:0, now my application worked flawlessly and i got an ip too. :)

I'm deeply thankful to you,

I didn't need to load the driver into the kernel it works without, weird.
 
Hi, manu, execuse me to reopen the solved thread,
I seem not be able to get a connection to outside the host, to have functional network i have to bridge it to: vmbr2, like that:
on usual kvm i would use:
Code:
net0: name=eth0,bridge=vmbr2

and all will be fine, but how should i set the bridge with our args case here:
Code:
args: -net nic,model=pcnet
 
Hello Manu, could you help me out, too?

args: -net nic,model=pcnet
balloon: 0
boot:
cores: 2
ide0: local:704/vm-704-disk-0.qcow2,size=563M
ide1: local:704/vm-704-disk-1.qcow2,size=1G
ide2: local:704/vm-704-disk-2.qcow2,size=102M
ide3: local:704/vm-704-disk-3.qcow2,size=307M
memory: 2048
name: inno-pbx
numa: 0
ostype: l26
scsihw: virtio-scsi-pci
smbios1: uuid=acca2ee8-f560-4cfc-9f32-9e15bd12e229
sockets: 2
vga: std
vmgenid: b2031d1d-5a20-43b4-94ff-d56d93cf1404

->

kvm: -device VGA,id=vga,bus=pci.0,addr=0x2: PCI: slot 2 function 0 not available for VGA, in use by pcnet
start failed: QEMU exited with code 1
 
Hello,

i have the same issue like lexid.
Is the pcnet device still supported by the 7.1-12 Version?


kvm: -device VGA,id=vga,bus=pci.0,addr=0x2: PCI: slot 2 function 0 not available for VGA, in use by pcnet
TASK ERROR: start failed: QEMU exited with code 1
 
Hello,

i have the same issue like lexid.
Is the pcnet device still supported by the 7.1-12 Version?


kvm: -device VGA,id=vga,bus=pci.0,addr=0x2: PCI: slot 2 function 0 not available for VGA, in use by pcnet
TASK ERROR: start failed: QEMU exited with code 1
Have a look at this forum post here

You have to change the args line such that you specify a particular pci bus address that is not already in use, e.g.
Code:
args: -net nic,model=pcnet,addr=0x16

I still struggle with getting the disk to boot in the first place., however. It is stuck on
Booting from Hard disk ...
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!