Page 1 of 1

Linux: Running Both Native and VM ...

Posted: 27. Dec 2010, 21:02
by sfranzyshen
I currently run ubuntu 10.10 installed on a (bootable) USB stick on a ext3 partition. I can run it natively (boot directly) or run it under a VirtualBox
container. I would like to install the guest additions, but I know this will break a few things (xwindows) from working properly when run natively
again. I have seen a few howtos for doing this with windows (guest) by creating "hardware profiles". Has anyone figured out a way of doing this
under ubuntu yet? Can I have one profile for Native and another profile for VirtualBox? and switch (or automatically detect and switch) between
them?

thanks
sfranzyshen

Re: Linux: Running Both Native and VM ...

Posted: 30. Dec 2010, 22:19
by Sasquatch
You can create an init script that will run before X starts and let it check for it's environment. Easily done if you check for certain hardware, like the video controller. Then have two different xorg.conf files (if the X server supports it still) and alternate between the two depending on the detected hardware. Crude example:

Code: Select all

if [ "`lspci | grep VGA | grep nVidia`" ] ; then
	echo "You got an nVidia video card!"
else
	echo "No nVidia video card found, that's too bad"
fi

Re: Linux: Running Both Native and VM ...

Posted: 1. Feb 2011, 22:50
by myd0j0
I saw this post regarding booting Ubuntu 10.10 from USB natively as well as in a VM and I'm interested in doing this as well--I've been looking for several weeks in fact. You didn't happen to use the LiveUSB Creator to do that did you? I'm looking for an alternate method as I understand that the casper loop file will eventually fill up. I currently use Ubuntu 10.10 on an external 500Gb USB hdd, but would love to be able to boot it both natively as well as in windows using virtual box. Any ideas?

Re: Linux: Running Both Native and VM ...

Posted: 4. Feb 2011, 20:42
by Sasquatch
myd0j0, you're not making any sense. Please create a properly structured post with information in the right place. It's now an unstructured mess.

Re: Linux: Running Both Native and VM ...

Posted: 13. Feb 2011, 20:53
by myd0j0
Sasquatch wrote:myd0j0, you're not making any sense. Please create a properly structured post with information in the right place. It's now an unstructured mess.
There is a tool called LiveUSB Creator; it installs a portable virtualbox using a livecd distribution with a casper loop file so that changes to the system can be persisted across reboots. My understanding of the loop file is that it will eventually fill up and no further changes will be able to be made. Using this LiveUSB Creator tool, the installation allows the livecd to boot up by itself, or by using the virtualbox in a host.

I am interested in something similar, but without the limitations of the livecd/casper loop file. Which is how I interpreted the op. So, I have this Ubuntu 10.10 system running on an external hdd. I would like the ability to boot it natively or within virtualbox on a host windows OS.

Re: Linux: Running Both Native and VM ...

Posted: 13. Feb 2011, 21:15
by Sasquatch
What the OP has, is a normal PC where he installed Linux on a partition of his hard drive. Then in the other system he dual-boots between, he has VB and created a RAW disk VMDK which points to the Linux partition. Since the Guest Additions only need to be loaded when running inside VB and can cause problems if it's running on a native system, he needs to see where it runs on (VM or native) using a script and start the GA if it's in VM mode.
It's nothing like your question. You want to have a Linux system act as a VM host no matter where you are, be it at home or at work/school. That is not supported by us.