1

I want to install two different linux distributions on the same PC.(I know that the best method to my knowledge is either dual boot or VMware). but the extra feature that i want is also to swap the operating systems with a physical key in just a second(or maybe 2).

An Add-on optional question- Can a hacker retrieve data from other linux distro while I am running another linux

7
  • I don't understand your question, you said 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? Commented Apr 11, 2021 at 17:41
  • @ArkadiuszDrabczyk i will edit it to - best to my knowledge
    – Anonymous
    Commented Apr 11, 2021 at 17:50
  • @ArkadiuszDrabczyk I want to ask for suggestions maybe a feature that i am not aware of or any other feasible method to accomplish my task
    – Anonymous
    Commented Apr 11, 2021 at 17:51
  • vSphere Hypervisor? Commented Apr 11, 2021 at 18:07
  • what do you mean by swap? ... if two VMware instances are running on a PC then Alt-Tab would switch the focus between them
    – jsotola
    Commented Apr 11, 2021 at 18:18

1 Answer 1

3

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:

  1. Setup hibernation on both systems. You don't need to have a swap partition prepared in advance, swapfile would work as well.

  2. 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.

  3. Tell kernel to reboot instead of shutting down the next time hibernation is done by doing echo reboot | sudo tee /sys/power/disk.

  4. 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.

4
  • you have mentioned atleast, so can i assume that there are more options.
    – Anonymous
    Commented Apr 11, 2021 at 19:01
  • thanks though..
    – Anonymous
    Commented Apr 11, 2021 at 19:01
  • I believe there might be more options to achieve that but I don't know any, Vagrant is the only thing that comes to my mind at the moment but it's a wrapper over virtual machine supervisor. But I can imagine a professional solutions used in datacenters that I have never heard of. Commented Apr 11, 2021 at 19:04
  • Depending on what you need chroot might be another alternative. The hibernation solution is very elegant.
    – Stewart
    Commented Apr 11, 2021 at 20:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .