Creating VM in IPFire

I’ve installed the addons qemu & libvirt, but have been unable to create a VM. I mainly want to use such to check whether or not various Linux distributions:

  1. install as VM (EndeavourOS, eg, does not)
  2. upgrade reliably, to next release

There is an example procedure in https://wiki.ipfire.org/addons/qemu, but most of the parameters appear to be superceded, or at best deprecated and result in error messages “invalid option”, “file not found” etc.

The example also uses network mode NAT, while according to https://wiki.ipfire.org/addons/libvirt, only “bridge” is now supported in IPFire. Documentation in https://wiki.ipfire.org/qemu & QEMU/Networking - Wikibooks, open books for an open world focus on TAP, which is no longer supported in IPFire.

Could somebody please give me an example “qemu-system-x86_64” syntax, that works in creating a VM in IPFire ?

I have not used the command line options since we have libvirt.
Install libvirt on the IPFire after this you can use virtmanager on a client your network to manage vm’s on the IPFire.

First switch the zone config ( wiki.ipfire.org - Zone Configuration ) for the zone that you want use in the vm to bridge. (This will enable the ability to add a virtiual nic from qemu to this zone via virtmanager.)
After this run virtmanager and connect to the IPFire to create/manage virtal machines.

Thanks Arne,

I’ll give that a try. I have been using Virtmanager in openSUSE on my desktop, but my desktop & laptop are limited to 8 GB RAM, whereas my new IPFire has 16 GB, as well as running 24/7.

I have set up a connection from desktop to IPFire, but when I try adding a virtual NIC, I get a message, to the effect, that it is not supported by the connection. Uncertain whether that constraint is in openSUSE or IPFire.

I have set up IPFire as a VM on the desktop, for testing releases, and it is sufficiently compact to run OK there.

I too have the same problem. Thanks to Arne I just managed to get QEMU (Windows 7) working inside IpFire. But all via virt-manager, installed on Ubuntu.
I too am interested in starting QEMU (Windows 7) directly from the IpFire shell, in any way. It’s possible?
I tried with this syntax:

qemu -vnc :1 -smp 1 -hda /mnt/harddisk/macchine_qemu/windows7.img -m 1024 -usbdevice tablet -k it

but it has big limitations (for example it creates 2 different networks between QEMU and GREEN) and other problems.

@arne_f

Attempting to create VM on IPFire from another host continues failing, being unable to find a “default suitable network”. I had previously changed green0 to bridge mode, as suggested in https://wiki.ipfire.org/addons/libvirt The following names for the bridge on green0 all fail:

Attempting to identify the default nework also fails

Attempting to run associated virsh commands directly on the IPFire machine generates error messages

What is the default virtual network called ?

It’s the same problem I encountered. It was hard to figure out how to fix it.

Referring to the first published figure:
I just wrote by hand
green0
inside “device name” and I gave ok.
and everything works for me.
Of course I first set green0 as the bridge as suggested by arne_f.

Referring to the second figure published:
Same thing to me too. But if you handwrite green0 like I said it should work just the same. It works perfectly for me!!!

Forgive me for the English I barely know.

Everything works for me!!! I managed to figure out how to start the virtual machine (previously created with virt-manager) directly from the IpFire shell. It’s really simple. Here are the shell commands:

List of installed machines:
virsh list --all

MACHINE START:
virsh start nameVM

MACHINE SHUT OFF:
virsh shutdown nameVM

I hope they can come in handy.

I can’t get the syntax that you used to run:

hda & hdb are reported as already in use on my IPFire. What core of IPFire are you running ?

Hi, thank you for your trust.
I send you my fireinfo,

https://fireinfo.ipfire.org/profile/732fef80c785b15598d2a3c2afb59b5bfa5c7885

But in my opinion you should focus on the solution suggested by arne_f.
That syntax only works well for me on an emulated 32-bit operating system, has many limitations and is complicated to adapt to your needs.
I abandoned her. The system suggested by arne_f looks great to me. The machines you create with libvirt remain fully installed in IpFire and you can launch them from the IpFire shell with

virsh list --all

virsh start nameVM

virsh shutdown nameVM

The only problem is that if you installed an operating system using QEMU, you will probably have to reinstall everything. At least for windows 7 for sure.

Anyway, I’ll try to explain my syntax better:

-vnc :1 = from client, open vnc, type the IP address of the IpFire machine followed by port 1
-hda /mnt/harddisk/macchine_qemu/windows7.img = Full path to the image containing the operating system previously installed with QEMU
-m 1024 = memory to be assigned to the emulated machine.

TO INSTALL THE OPERATING SYSTEM FOR THE FIRST TIME:
qemu -vnc :1 -hda /mnt/harddisk/macchine_qemu/windows7.img -cdrom /mnt/harddisk/Windows7setup.iso -m 1024 -net nic -net user -boot d -usbdevice tablet -k it

-cdrom /mnt/harddisk/Windows7setup.iso = Full path to the ISO image containing the operating system to be installed.

If the ISO images are located in other folders within the Hard Disk mounted in IpFire, you can change /mnt/harddisk/

Forgive me again for my english.

1 Like

Of course, I’m assuming that you first installed the QEMU addon and created the machine with the command:

qemu-img create -f qcow2 /mnt/harddisk/win7x32.img 80G

/mnt/harddisk/win7x32.img = you can change according to your needs.
80G = size of the virtual disk duo.

If you use libvirt (virt-manager), this syntax is “replaced by gui”.

There would also be another system, suggested to me by cfusco.
Frankly, I haven’t tried it, but it seems to me excellent too, as far as I’ve been able to understand.
You can find it in this post:

Inside the page, look for:
If you do not want to use virtmanager, this is how I do it from the command line…
and see if it can help you.

Thanks for your assistance.

I could get your qemu syntax for creating an img file to work. I can get your syntax for creating a VM to run, but can’t get vncviewer to connect to IPFire, so installation does not proceed.

I can readily get virt-manager working between two openSUSE hosts and that suffices for my use.

There appear to be too many configuration differences for virtualisation between openSUSE and IPFire. It is not worth my time sorting it out. Reinstallation of IPFire is on my agenda, for a later date.

Thank you too for the trust. I struggle to understand English and the automatic translators are not the best.
I try to express myself according to what I think I understand from your message.

  1. You can very well make my syntax work for creating an img (Virtual Hard Disk) file. Use:

qemu-img create -f qcow2 /mnt/harddisk/win7x32.img 80G

as already mentioned in my previous post.

  1. It’s super easy to connect vncviewer to IPFire (it was for me). I give an example: First run QEMU… from IpFire shell. Then open VNC from a client machine. Then write this:

10.168.1.254:1

replace the IP with the Gateway address of your IpFire green. Replace the port with the one you used in qemu (-vnc :1) in my case.
I am attaching the photo. I’m using a VNC client under windows, but you can use any operating system.

For openSUSE hosts I don’t know what to say. Never used. I solved with virt-manager installed on xubuntu to create the machine.

I remain available for anything, according to my small skills regarding IpFire and my English.

I hope you will solve.

I’ve now done a fresh install of core 171. I also installed package “qemu-ga”, which is not mentioned in https://wiki.ipfire.org/addons/qemu

Virt-manager now works sufficiently to create and manage VM. The main shortcoming is that it still does not allow creation of virtual networks. Nor does “virsh net-create some.xml”. Consequently I can’t create:

[https://libvirt.org/formatnetwork.html#network-config-with-no-gateway-addresses], which I find is the appropriate virtual network for green/blue in testing IPFire as a VM, although I have no need for it in other VM.

Now that I can create VM, I see that virtualisation in IPFire does support “spice”, which is the default graphic remote terminal in other implementations of virt-manager that I have investigated. Consequently I have no need to get VNC working.