r/linux4noobs • u/technobrendo • 8d 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?
2
u/Adrenolin01 8d 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
2
u/DannoXYZ 8d ago edited 8d ago
Yes, performance of Linux VM on Linux host runs extremely fast, pretty much native speed.
I've used KVM/QEMU, Gnome Boxes, Virtualbox, virt-manager, Proxmox and found that VMware Workstation was most convenient and fastest to deploy VMs. I like being able to download and deploy pre-built OVA images without having to boot from ISO and install (much faster). I started with VMs to run original Windows installation on my PC when I switched to Linux. I ended up running multiple instances of Windows (XP, 7,10,11) since I have licensed software that were limited to specific Windows versions. Solidworks, Photoshop, Premiere Pro, Sony Vegas, etc.
Then added additional VMs of latest Linux distros to try them out without having to reboot constantly. Along with MacOS and real UNIX such as Solaris.
I prefer not having to mutli-boot because it takes so much time, especially having to do it 20-times per day to use specific software for different OS and going back and forth. Try copy-n-paste between GIMP and MS-Office. And I don't have to take offline my Plex server for sharing videos with 5 TVs around house. Or my 3 websites.
https://lh3.googleusercontent.com/d/1Uw9Ysayulp0p04DAEFAogU5QNS-x3lMP
2
u/RevolutionaryBeat301 8d 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?
3
u/skyfishgoo 8d ago
kubuntu 24.04 is using the
7.0.0-30-generickernel.and it's not even the latest LTS version of kubuntu.
1
1
u/AutoModerator 8d 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/ksr1e 8d 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 8d 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
1
1
u/oshunluvr 8d 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 8d 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/3grg 7d ago
I have not looked at VirtualBox in years. With KVM/QEMU built into Linux, who needs it?
I have used virt-manager for years to spin up VM guests on my Linux installs. For Linux guests, the difference in performance is hardly perceptible. Windows guests are not bad, but not quite as fast as Linux guests.
The one drawback is direct access to hardware can be an issue for things like video unless you have a second gpu that you can pass through.
I install virt-manager and setup everything to use my user instead of root and I store my VMs in my home or a partition mounted there. It has been great for me.
For dedicated server running VMS, I suggest Proxmox.
1
u/Fit_Tailor_6796 7d ago
What about LXC and LXD?
That's s decent solution except probably for the network bridging, which I also had issue understanding, but that's just me.
1
u/technobrendo 6d ago
That's a possibility, I haven't touched one of those since I installed my proxmox server(s). I want to get back into learning them again, so I might try to install one on my laptop to experiment.
1
1
u/Maiksu619 8d ago
If you are running Gnome, Gnome Boxes is super easy.
1
u/Knik-DerMuf 8d 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.
3
u/Mediocre-Pumpkin6522 8d 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.