LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   Start the same OS twice (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/start-the-same-os-twice-4175515446/)

capellone 08-19-2014 06:23 AM

Start the same OS twice
 
Hello,

I have a Fedora 20 machine (native mode, no VM).
Each time i log in, i set (in .profile) an environment variable ROOT_PATH=/home/ddd/path1 which is then used by all the programs i start later (and which cannot be changed on the fly).
If i want to set ROOT_PATH=/home/ddd/path2, i must update the .profile file, then restart.

Question: It is possible to have 2 instances of the same Fedora20 running at the same time? I want one instance for path1 and another for path2.
Both instances would use the same HDD.
How to do it?

Thank you!

YankeePride13 08-19-2014 08:27 AM

You could just open up two sessions and change the variable on one of them.

TobiSGD 08-19-2014 08:48 AM

Quote:

Originally Posted by capellone (Post 5223550)
Hello,

I have a Fedora 20 machine (native mode, no VM).
Each time i log in, i set (in .profile) an environment variable ROOT_PATH=/home/ddd/path1 which is then used by all the programs i start later (and which cannot be changed on the fly).
If i want to set ROOT_PATH=/home/ddd/path2, i must update the .profile file, then restart.

Question: It is possible to have 2 instances of the same Fedora20 running at the same time? I want one instance for path1 and another for path2.
Both instances would use the same HDD.
How to do it?

Thank you!

Create two different users, both with their own .profile file. No need for two OSes.

frieza 08-19-2014 02:46 PM

yes, 2 users is what you need, each user account has it's own .profile
running 2 or more simultaneous instances of an operating system would require some level of virtualization, either via a virtual machine running as a guest on top of a 'host' OS (such as virtualbox) or a 'bare metal' virtualization such as the xen hypervisor.

jefro 08-19-2014 03:02 PM

"It is possible to have 2 instances of the same Fedora20 running at the same time?"
A simple answer is no you can't for the most part. Not saying it can't be done just you don't want to even attempt it.

It is possible to chroot and I think that is what you may be asking or getting at.

capellone 08-20-2014 03:28 PM

Thank you all for your answers!
There is another constraint i forgot to mention: in each session i start several servers; i cannot run two instances of the same server on the same computer at the same time because only 1 will successfully bind to configured port, so i need a kind of "processes/memory/network isolation"; i posted my question in this forum because maybe there is a virtualization solution i coould use, but i was unable to find one so far.

frieza 08-20-2014 04:11 PM

you could try xen project hypervisor
http://wiki.xenproject.org/wiki/Xen_...eginners_Guide

TobiSGD 08-20-2014 04:46 PM

If all you want is to have running the same server on different ports or even different IPs on the same machine than virtualization using Xen, KVM, Virtualbox, ..., is definitely overkill, this is a perfect job for LXC containers or, since you run Fedora, systemd-nspawn, it uses much less resources and is very easy to set up.

I guess on Fedora systemd-nspawn is the preferred method for containers: https://fedoraproject.org/wiki/Featu...ightContainers


All times are GMT -5. The time now is 04:27 PM.