Predictable Network Interface Names preventing VM from connecting to network

SylentK

New Member
Nov 9, 2017
4
0
1
52
The use case of my ProxMox server is to host Capture The Flag (CTF) images (mainly from vulnhub.com). I ran into a problem with a CTF VM called "Bulldog".

My procedure to install was to first untar the .ova file, convert the .vmdk file to .raw, create a blank VM in ProxMox, and dd the .raw file over to the location of the disk image of the blank VM. The image boots up but gives me a "Failed to start Raise network interfaces". Now, if this was a VM I had an account on, I could log in and make the interface in /etc/network/interfaces match what is seen in ifconfig (the problem is that the system cannot get the interface specified in /etc/network/interfaces started). Because the whole point of the VM is to train offensive security folks to access a vulnerable host, I do not have login creds and so I cannot make those changes in the console (I verified the problems by finding a spoiler write up and figured I would learn what was wrong and apply that to future VMs - this one was spoiled for me).

The ifconfig command reported that the network interface was called "ens18". /etc/network/interfaces says its called "enp0s3". This seems to be a problem with regard to Predicable Network Interface Names, as those which do not use that naming style do not appear to have this problem. So, my question is: Is there any way to configure the network interfaces before I import/bring up the VM in proxmox? The interfaces of the VM do not appear to be in the VM Hardware settings. Is there another step in the convert to .raw process I need to do?

Thanks
 
you can just a different network card type in the VM hardware settings, maybe one of them gives you the right "slot" inside the VM. or you can boot a live cd in the VM, mount the disk and edit /etc/network/interfaces to match what you currently have.
 
you can just a different network card type in the VM hardware settings, maybe one of them gives you the right "slot" inside the VM. or you can boot a live cd in the VM, mount the disk and edit /etc/network/interfaces to match what you currently have.

Thanks. I have tried the other options (e.g. Intel E1000, Realtek, VMWare), but alas, that did not make it work. I also removed the network interface and added it again hoping that would fix it.

The VM is not an install and the VM does not give me access. Again, the point of the VM is to train infosec people to get access to vulnerable machines - no access to the OS is provided, so I cannot access the /etc/network/interfaces directory.

It works just fine in VirtualBox, so I am confused as to what the difference is. I have all the settings as they should be.
 
Thanks. I have tried the other options (e.g. Intel E1000, Realtek, VMWare), but alas, that did not make it work. I also removed the network interface and added it again hoping that would fix it.

The VM is not an install and the VM does not give me access. Again, the point of the VM is to train infosec people to get access to vulnerable machines - no access to the OS is provided, so I cannot access the /etc/network/interfaces directory.

It works just fine in VirtualBox, so I am confused as to what the difference is. I have all the settings as they should be.

you have full control over the hypervisor, so the VM cannot prevent you from accessing the files ;) just put in a live cd in the virtual CD drive, mount the disk and edit the file. the difference is that the VM expects the NIC to be on a certain slot (see https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/ for what enp0s3 means), and the defaults between virtualbox and PVE/Qemu probably differ..
 
Thanks a lot Fabian! That did the trick! I'm kinda kicking myself that I didn't think of that (it's how I access unencrypted filesystems!) I just didnt think to apply it to the virtual world. I simply put a Kali Linux (any linux would do) into the CD drive of the VM I am trying to access, then changed the boot order of the VM to boot from the CD. Once in, I chose the "live" option. Once I booted to my linux live CD, I ran an "fdisk -l" command and found the name of the disk I needed to mount. Then I just ran "mount /dev/mapper/[drive name I want to mount] /mnt. From there, I was able to access the /etc/network/interfaces file. I changed the file, unmounted the disk, shut down the OS, changed the boot order back to boot from the hard drive and voila, I was in :)
 

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!