LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Virtual Windows on Linux (https://www.linuxquestions.org/questions/linux-general-1/virtual-windows-on-linux-930881/)

mcollis 02-23-2012 09:20 AM

Virtual Windows on Linux
 
Hi All,
don't let the topic fool you please.

I was wonder if something can be done at all, in my mind this works but i've no idea how.

What I would like to know is:
Can you install a very basic Linux distro (ubuntu/suse/whatever) that once started then starts a virtual machine that can start up M$ Window$ in full screen and almost seamless.
I'm asking as I was thinking this could be an easy way to distribute windows to our client PCs and also allow us to simply keep a copy of the virtual PC for each of our client systems, and also allow us to only link certain USB devices to windows protecting it further (beyond our already created measures)

flamelord 02-23-2012 10:18 AM

I'm pretty sure this can be done using virtualbox or VMWare, although I am not entirely sure of the details.

sundialsvcs 02-23-2012 11:07 AM

VMWare can do that off-the-shelf.

The technology is called virtualization, and it is actually built using features of the microprocessor hardware which allow the CPU to switch between entire machine contexts. The "host" operating system can be of any sort; likewise the "guest(s)." When a guest OS is running, it perceives the hardware to be whatever you set it up to be for that guest, but it is running at full speed. All of the mechanisms for defining a bulletproof virtual execution environment are ultimately provided by the CPU hardware itself, but under software control.

lithos 02-23-2012 01:11 PM

Hi,

I know from the other way around, executing Linux VM machine (VirtualBox) from Windows hosted machine.
In VirtualBox you create a shortcut to desktop (with running full screen), which I copied then to startup folder in Windows and that's it, then it starts automatically when Windows is started.

I don't exactly know where to put the 'shortcut' in Linux to start automatically at startup (I know some scripts run at startup in /etc/rc.local)

good luck

flamelord 02-23-2012 01:15 PM

getting it to run on startup is somewhat distribution dependent, and there are multiple ways of doing it.

catkin 02-23-2012 01:16 PM

It could definitely be done by auto-logging-on a user to the GUI desktop and using an autostart to start the VM but I wonder if it is possible to do it more cleanly by starting X and then starting the VM as the only window with no window controls (title bar etc.) ... ?

Dark_Helmet 02-23-2012 01:38 PM

If I understand what's being asked, then "yes"

To make sure, let me re-phrase. You want to install a linux distro, but you do not want the user to ever know that the machine is running linux. Specifically, the linux install is just the platform, and the user is presented with a fullscreen virtual machine launched immediately on boot.

To do something like that, you need to use a different X display.

The basic command for something like this is:
Code:

xinit /path/to/application -- :display#
Replace /path/to/application with the path to the application to run (e.g. for VirtualBox it would be something like "VBoxManage --startvm 'virtual_machine_name'") and replace display# with a numeric value.

The application should start and occupy the entire screen for the X display number you specify. Keep in mind, display :0 is the primary display.

If you use display :0, then you'll need to replace your distibution's default setup. You'll need to look at how they configure xinit. For Debian, my system seems to use /etc/X11/xinit/xinitrc as a base, which then points to /etc/X11/Xsession. You'll need to track down all that stuff, find out what it's doing, and either replace or modify it to create the display you want.

EDIT:
For clarity, I should add that the above could handle the autostart and fullscreen display issues. Keep in mind that the virtual machine software you use may add other complications for "seamless" operation. In other words, you may need to add some behind-the-scenes scripting/code to handle CD insertion/removal... likewise for USB... and any other similar devices.

sundialsvcs 02-23-2012 04:59 PM

I set up just such a "silent" distribution of Linux to run a legacy DOS application and I simply arranged for the boot-loader to go straight to Linux and for Linux to immediately start itself in a so-called run-level (Google such terms as "init," "inittab," and "runlevel" for more) which took me straight to an (in this case...) DOS-emulator program running as an automatically logged-on but absolutely non-privileged user, running in a chroot jail. The Linux distribution in question (Gentoo...) was stripped-down to the minimum necessary to run on that hardware (which was known in advance), "Gentoo" being chosen because that's a distribution that compiles everything from source.

And it worked perfectly. (Still does, in thousands of unsuspecting high-rises across the nation.) The DOS program had no idea it wasn't running on a computer from the late 1980's, but none of the inherent limitations (by modern-day standards) of DOS existed.

jefro 02-24-2012 09:44 PM

Not sure about the legality of the plan.

Might look at the 2X.com stuff. They sort of do stuff like that.

rich_c 02-25-2012 02:28 AM

+1 for absolutely do-able. I have Windows running as a Virtualbox guest on my Linux host. I'm fairly certain the ins and outs of auto logging in the required user id & running a script at startup to fire up the virtual guest would be fairly trivial.


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