I installed the QEMU addon with Windows 7 emulated.
Windows 7 IP address under emulator (assigned by QEMU) is 10.0.2.15
I would like QEMU to assign Windows 7 an IP belonging to my GREEN network (example 10.168.1.111). In other words, I would like QEMU’s network and GREEN to be the same network.
I did many tests and even IpFire got damaged. I had to reinstall the whole system. Luckily I had exported the Configuration Backup.
Some advice?
Thank you in advance.
and switch the network mode of qemu from user to tap mode and add the virtual device to the bridge after the machine was started. After this you should get a dhcp from green.
I use the libvirt addon and virtmanager on a client to manage vm’s becasue this is much easier then use the qemu commandline options.
If you do not want to use virtmanager, this is how I do it from the command line (not in IPFire but on a headless dedicated machine). Adapt to your needs vm name, disk size, cpu number, memory, guest OS. In extra args I enable the console, therefore I can access the guest from the host with virsh console vm_name.
Be careful, do not copy and paste, as there could be invisible characters created by my editor. Never copy/paste, always type the commands yourself, after you have understood what they do. No guarantee that these commands or links still work. You have the responsibility of your machine, not me. Use it only as the starting point for further research.
INSTALL VM
In bash ctrl-x/ctrl-e will allow you to open the editor and paste the whole text, as you close, it will be executed in the shell.
Live means that you create a temporary image that is in use while you backup the base machine. After backup, you merge back the temporary image and then delete it. If you shut down the virtual machine during the backup, all this is unnecessary.
If MBR partition, resize is up to 2 TB. Otherwise it has to be converted to GPT first, then extended.
These are the steps:
truncate -s 1700G new_vm_name.img virt-resize --no-extra-partition vm_name.img new_vm_name.img virsh edit vm_name
change the image file to point to new_vm_name.img virsh start vm_name virsh console vm_name
once inside convert to GPT partition from MBR:
fdisk -l see what is the device (/dev/vda)
gdisk /dev/vda
create a new partition in the first MB of the disk (sectors 34-2047), hit n
assign BIOS Boot code (ef02)
save with w
partprobe /dev/vda
grub-install /dev/vda
reboot
now extend partition to occupy the whole space.
fdisk /dev/vda
delete part 1
recreate part 1 form 2048 to end
assign type Linux filesystem
chek
write
df -hT
resize2fs /dev/vda1
df -hT
Works!!!
I have chosen to adopt this procedure. With hard work and a long time I succeeded!!!
But now I would like to start the machine directly from the IpFire shell, with a command like: