If you want to run more than 1 operating system on the same machine
you have at least 3 options:
Run one system natively and run the other one at the same time inside
Docker container. Containers are small and lightweight, usually
slimmed down to take less space, they share kernel with the host OS
(the one installed natively), do not come with their own init and
usually do not come with X/Wayland so running GUI programs inside them
can be problematic. Docker containers are extremely popular among
software developers as you can use them to quickly re-create the
development environment and make sure that everyone uses the same
versions of compilers, shared libraries, Python packages, etc.
Run one system natively and run the other at the same time inside
virtual machine supervisor such as VMware or Virtualbox. I have never
used VMware but Virtualbox is free and works very well. However, make
sure that you have enough RAM to run 2 operating systems at the same
time, modern desktop Linux distributions require at least 2GB of RAM
to work as intended.
Run both systems natively - you cannot run 2 of them at the same time
though. And yes, it would possible to cycle between them using a
keyboard shortcut but it would require some manual setup:
Setup hibernation on both systems. You don't need to have a swap
partition prepared in advance, swapfile would work as well.
Use efibootmgr to choose the next system that will booted after the
reboot as explained at
https://superuser.com/questions/1016762/is-it-possible-to-select-which-system-to-boot-before-rebooting-on-a-multi-boot.
Tell kernel to reboot instead of shutting down the next time
hibernation is done by doing echo reboot | sudo tee /sys/power/disk
.
When the required system is up restore the original behavior by
doing echo platform | sudo tee/sys/power/disk
You can create a script that would do steps 2-4 for you and optionally
assign a keyboard shortcut to run the script.
I want to install two different linux distributions on the same PC.(I know that the best is dual boot or VMware)
- so how are you going to install actually install the second OS - using dualboot or VMware?swap
? ... if two VMware instances are running on a PC then Alt-Tab would switch the focus between them