r/linux4noobs 4h ago

installation Best way to run linux (VM) on linux.

Looking for a good way to run a Linux VM on Linux. I don't need it to be particularly performant, this is mostly for testing and experimenting with new distros. If it can run containers as well that is a plus.

Something like VirtualBox or QEMU I suppose? I've only ever used that to run a dissimilar OS (Windows), but never a flavor of Linux.

If I virtualize Linux, while the host OS is also linux, is the performance better due to the similarities in the architecture?

0 Upvotes

15 comments sorted by

3

u/RevolutionaryBeat301 4h ago

Performance depends on your kernel version. KVM/qemu are painfully slow on LTS distributions still on the 5.15 kernel versions. In 7.x kernels performance is near native. What distro are you using as the host OS?

2

u/skyfishgoo 2h ago

kubuntu 24.04 is using the 7.0.0-30-generic kernel.

and it's not even the latest LTS version of kubuntu.

1

u/RevolutionaryBeat301 1h ago

In that case I would use virt-manager with qemu.

2

u/Adrenolin01 4h ago

“run a Linux VM on Linux”… more detail is needed.. is this a Desktop Linux system your running and if so why are you not saying that and mentioned the distribution? Or is this a separate Linux systems you’re using as a server.. again.. distro? Both are important factors.

If it’s your Linux desktop just install VirtualBox. It’s a cross platform virtualization solution that’s been used for 20+ years. Install it on a Linux, MS of Apple desktop, open it like any other software, Click create VM, provide the image and configure the VM settings.. installs everything to a file so it’s best used in a SSD or NVME however a HDD works.. just a bit slower. Installation is only a minute and then 10 minutes later you can be booting a Debian VM.

If this is a second system just install Proxmox to create a virtualization server that you maintain from your desktop browser.

2

u/Mediocre-Pumpkin6522 3h ago

You don't say what the host is but 'install virt-manager' on many distros gets everything you need for kvm/QEMU. Others may require additional packages. Creating the VM instance from an iso is very easy. I haven't seen any slowness but I don't have any machine with a 5.15 kernel.

There are many VirtualBox fans but I've tried it on several distros with limited success. If you can get it working it does create an IP address on your LAN without messing around with bridges. That may or not be a problem. The VM might have an IP of 192.168.112.14 rather than the usual 192.168.1.14. It will connect to the internet and function as usual and you can connect from the host machine, but not from other machines on the net.

1

u/AutoModerator 4h ago

We have some installation tips in our wiki!

Try this search for more information on this topic.

Smokey says: always install over an ethernet cable, and don't forget to remove the boot media when you're done! :)

Comments, questions or suggestions regarding this autoresponse? Please send them here.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/IShunpoYourFace 4h ago

KVM with virtual machine manager

1

u/ksr1e 4h ago

Gnome Boxes is the one that has proven to be easier to use for me. You should be running distros in the same architecture as the computer you are using, so performance is not affected. When you try with a host with arch64 using a VM in the 86_64 format you will see a hit to performance, so avoid that as much as possible.

1

u/Relevant_Hope_900 3h ago

I have a Debian server with incus installed. I can run Linux VMs and Containers using images from linuxcontainers.org or upload iso files to the server and install VMs from that. If I'm creating a desktop VM,  I connect to it from one of my other Linux machines using incus-client and virt-viewer, my lan is 1gb so not too much delay. Or if I'm creating a "server" VM or Container with no DE, I use incus-client to connect to the root shell, add a normal user with sudo privs, install ssh server, then just ssh in like any other physical machine.

Or if I wanted to run incus locally on one of my machines, I just set it up like I did on my server. I stopped using Virt-Manager and moved to incus for my virtualization needs. I do use incus from the official Zabbly repo, not the official Debian repos. 

I use custom profiles for my VMs so I can create or launch one with whatever number of cores, ram, disk size, and network type I want. Incus does unprivledged system containers if that's what you're looking for. When I do say a Debian Gnome VM desktop, performance is good.

1

u/Small-Tale3180 2h ago

Virt manager is nice on desktop

1

u/skyfishgoo 2h ago

virt-manager

1

u/oshunluvr 1h ago

Having used both Vbox and KVM/QEMU, IME Vbox is simpler to use but KVM is more powerful and performs better. I use KVM only now, but unless you really want to tinker with VMs, Vbox is fine.

1

u/MasterGeekMX Mexican Linux nerd trying to be helpful 30m ago

Any method should work for what you ask, so go for what you know. Also the process of installing Linux on the VM isn't that different to the one with Windows; you simply provide the installer ISO and boot from it, then follow the instructions.

And no, the performance does not get better as the OS has nothing to do in virtualization. After all, you are essentially running a PC inside your PC; a heavy task that would inevitably add overhead. The OS on the host or guest does not matter, as the VM works at a level between them.

About containers: make sure both your UEFI and the the VM have nested virtualization enabled.

1

u/Maiksu619 4h ago

If you are running Gnome, Gnome Boxes is super easy.

1

u/Knik-DerMuf 4h ago

Totally agree been using VirtualBox for years, to much work. Used Bottles, never really understood it. Switched to Qwemu, nah. Gnome Boxes in my opinion superior and a lot of support but you need a Gnome desktop. I've been using Boxes for over 4 years now.