IPFire loaded to Azure VM

Uploading a local IPFire to Azure, made the VHD in Hyper-V and managed to load it to a blob storage. Was able to create a VM in Azure (Gen1, Linux, 1xCore, 2GB as per spec) following some online info. VM takes 30 min to start or stop. Boot diagnostics shows me the IPFire start up screen OK. Cannot SSH into it. I think I missed some steps with the disk as it is not very well documented. ( GitHub - ezlee/ipfire-azure: ARM Templates and Instructions on using IPFire on Azure ). Need IPFire as I have a hardware IPFire onsite. Any help much apreciated.

Welcome to the IPFire community.
Have you read the Wiki page below?

edit

Below is the view after a fresh installation of IPFire

obraz

Edit2

Another way to enable ssh is to use elinks in the IPFire console.
obraz

obraz

Regards

No, there is something wrong with the image I made in Azure. It takes far too long to start and then ends with an error.


Same when you try and stop it.

Very slow to start and Stop 33min. I have increased the 4GB drive to 5GB (documented that 4GB is slightly over so new VM drive needs to be bigger)

PS C:\Users\AdministratorIE> Stop-AzureRmVm -ResourceGroupName “IPFire???” -Name “IPFire” -force
OperationId :
Status : Succeeded
StartTime : 30/06/2023 09:25:32
EndTime : 30/06/2023 09:58:17
Error :

There is this thread on Azure in IPFire.
https://community.ipfire.org/t/ipfire-in-azure/5587

1 Like

See that post, but got stuck on the line "mkinitrd --preload=hv_storvsc --preload=hv_vmbus -v -f initrd-uname -r.img uname -r " mkinitrd dose not seem to be a command that can be run inside IPFire console.

That user used mkinitrd because the image was created using VirtualBox on a Mac computer. The link to the Microsoft documents says that you have to use the appropriate command from the OS on the machine that the image is being created on.

However in post 3 of that thread, @ms says that he wouldn’t recommend modifying the initramdisk and that IPFire should be able to run on Azure as it is.

Beyond the above I can’t help you as I have never used Azure. The only VM I am using is VirtualBox for my development builds so I can test various things out without having to do it with my running production system.

Thank you for pointing that out, I have used both VirtualBox and HyperV (on Win10) to create the VHD, both with the same results. I am going to try it again make sure that I am more accurate in the size of the disk (1024 2048 & 3072 ) the make sure that the Azure disk is the next size up use Gen1 and 2 cores. I can see that it has started from the Azure VM Boot Diagnostic, I can see the screen shot of the IPFire boot.

The boot screen is not finding any network interfaces beyond the red one. Before the red interface is brought up there should be lines related to the green, blue and orange interfaces (depending on the setup). As a minimum there should be the green interface with the assigned IP Address.

You have the error message saying that the ADDRESS and/or the NETMASK variable is missing from the input. So there is not green interface and hence ssh cannot work.

Was the vm image confirmed to be working on the Win10 box before trying to upload to Azure and did that boot with the green interface message showing the IP Address you assigned during setup.

Here is what you should see in the boot screen. If you only have a red & green setup then you will only see the green interface part but it should tell you the IP Address that has been added to the green interface.

1 Like

Thinking about it for a bit, the other option you have is to log in to the IPFire console on your Azure system. Then run setup and choose Networking then choose Drivers and card assignments. You can then check if the correct mac address for the virtual network card is assigned to green.

If it isn’t then assign it unless there is no available mac address in which case you will need to recreate the vhd image.

Once the green is assigned to the correct mac address then you can go to the Address settings section and define the IP Address.

I have no access to the IPFire in Azure only to be able to ping the Green IP address from a Win11 AVD, SSH or Web do not work, like the IP session is locked up. That is after 30-40 min to start up.

You showed the boot screen that finished with the Login command. If you can only view that boot screen and not login then you will need to solve the problem with your missing green interface IP on the original vm on your win10 machine.

You need to get your vm working on the machine you are creating it on before you try and upload it to Azure.

@hzk916 I believe you’re missing a virtual NIC there to comunicate with the firewall. Either a private or a threaded NIC in the virtual switch. You only have the ethernet switch working there to 10.0.0* (amazon I suppose). unless you can get in the firewall through the red, the virtual NIC to green is not connecting,
Regards

Getting closer guys, I loaded a partial installed basic IPFire image (no RED/GREEN or credentials), it seems to have installed the RED nic on DHCP of Azure (10.0.0.5), now from the AVD I can see a web logon and SSH is giving me a login prompt.

1 Like

But, now from the root you’ll need to settup green unbound and network turn DHCP on etc etc :see_no_evil:! The ssh is disconected unless you turn it on from the root too.
Edit:
Pardon me can’t remember if by definition the ssh is on or off! ok

The script to restart network is /etc/init.d/./network (start/restart/stop) might this help during tests

I thought I would get a continue installing (IPFire) from the Bastion screen but no luck. Should be able to continue install with SSH (from Azure) once I complete an image with credentials. Problem is waiting, stopping IPFire VM takes 30-40min even with PS cmd using -force.

It’s a container, ok. The script to restart network without turning off and on is the one I told before (dot)/ . Wondering if theres a script to launch the setup menu (would be much more easier). Might some user from the comunity have this?! Or help you setting up the green network from scratch! I would try to use elinks to acess DHCP menu, (edit: enable it), setup the IP domain name and DNS to the virtual NIC IP and see if that works before anything else!
PS. If you try this don’t forget to restart network ./network restart

Regards
G70P

Finally I have a session up and running using a 4GB image with just the RED on DHCP. It still dose take 40min to start or stop in Azure. But from IPFire I can reboot in a few min. See ping gap. (Image from AVD). I only need this to connect Site-to-Site so I can print back to the office so probably wont need the GREEN?

:joy: :clap: :clap:
Just remembering that normal instalation don’t let you bypass without 2 NIC’s assign. Now a certificate SSL/TLS and don’t forget the password :joy:
Wondering What you can do with only one NIC despite penetration tests!
Congrats