Author Topic: Try linux... from within windows!  (Read 2758 times)

Nick1911

  • Administrator
  • Senior Member
  • *****
  • Posts: 8,492
Try linux... from within windows!
« on: July 30, 2009, 11:27:25 AM »
http://wubi-installer.org/

I'm installing it on my work laptop.  I will report my thoughts about it in a day or two.

Has anyone used this package?  It looks like a virtual machine and OS rolled into one.


BrokenPaw

  • friends
  • Senior Member
  • ***
  • Posts: 1,674
  • Sedit qvi timvit ne non svccederet.
    • ShadowGrove Interpath Ministry
Re: Try linux... from within windows!
« Reply #1 on: July 30, 2009, 11:36:54 AM »
It doesn't appear to be a VM; it looks like it's installing Ubuntu as a boot-time option, so you're either in Windows or in Ubuntu, but not both at the same time.

Still, it's pretty slick.  I remember the days where trying to get a dual-boot system going was an exercise in frustration.
Seek out wisdom in books, rare manuscripts, and cryptic poems if you will, but seek it also in simple stones and fragile herbs and in the cries of wild birds. Listen to the song of the wind and the roar of water if you would discover magic, for it is here that the old secrets are still preserved.

Ben

  • Administrator
  • Senior Member
  • *****
  • Posts: 49,400
  • I'm an Extremist!
Re: Try linux... from within windows!
« Reply #2 on: July 30, 2009, 12:19:24 PM »
That does look slick. I've been pretty happy with Virtualbox, but might have to give this a go on a test computer to see what it's like. Definitely give us a report Nick.
"I'm a foolish old man that has been drawn into a wild goose chase by a harpy in trousers and a nincompoop."

Nitrogen

  • friends
  • Senior Member
  • ***
  • Posts: 1,755
  • Who could it be?
    • @c0t0d0s2 / Twitter.
Re: Try linux... from within windows!
« Reply #3 on: July 30, 2009, 12:23:27 PM »
its even better than a boot time option

you're basically running the linux kernel as a windows application, under windows.

I used to run a version of this, called colinux ages ago, it works really well.
יזכר לא עד פעם
Remember. Never Again.
What does it mean to be an American?  Have you forgotten? | http://youtu.be/0w03tJ3IkrM

BrokenPaw

  • friends
  • Senior Member
  • ***
  • Posts: 1,674
  • Sedit qvi timvit ne non svccederet.
    • ShadowGrove Interpath Ministry
Re: Try linux... from within windows!
« Reply #4 on: July 30, 2009, 01:35:35 PM »
its even better than a boot time option

you're basically running the linux kernel as a windows application, under windows.

I used to run a version of this, called colinux ages ago, it works really well.


Nitrogen,

This is different from colinux; according to the Wubi FAQ, it's a boot-time-only thing.  What it does is it creates a virtual filesystem inside a regular file on the Windows partition, so no repartitioning is necessary.  But it doesn't run the kernel side-by-side with the Windows kernel.
Seek out wisdom in books, rare manuscripts, and cryptic poems if you will, but seek it also in simple stones and fragile herbs and in the cries of wild birds. Listen to the song of the wind and the roar of water if you would discover magic, for it is here that the old secrets are still preserved.

Gewehr98

  • friend
  • Senior Member
  • ***
  • Posts: 11,010
  • Yee-haa!
    • Neural Misfires (Blog)
Re: Try linux... from within windows!
« Reply #5 on: July 30, 2009, 02:30:02 PM »
Oh, the irony.

Imagine running WinE under WUBI under Windows!   :O
"Bother", said Pooh, as he chambered another round...

http://neuralmisfires.blogspot.com

"Never squat with your spurs on!"

zahc

  • friend
  • Senior Member
  • ***
  • Posts: 5,941
Re: Try linux... from within windows!
« Reply #6 on: July 30, 2009, 02:49:22 PM »
It's absurdly easy. It takes like 2 mouse clicks. It's not a virtual machine or "inside windows".

I did this to a computer at work which I'm currently running. I did it with one of my own machines for a while, one that came with windows installed, just because it's so easy to do.

The main disadvantage I can see is that it is using the NTFS file system. Besides corrupting the sanctity of your linux install, linux cannot fsck NTFS, so you have to boot windows and run chkdsk or whatever they have in windows if your file system gets corrupted from a power outage or something. But if you want to try out linux or install linux on a machine that you might want to be able to revert back to its previous form easily it's awesome.
Maybe a rare occurence, but then you only have to get murdered once to ruin your whole day.
--Tallpine

CNYCacher

  • friend
  • Senior Member
  • ***
  • Posts: 4,438
Re: Try linux... from within windows!
« Reply #7 on: July 30, 2009, 04:29:58 PM »
The main disadvantage I can see is that it is using the NTFS file system. Besides corrupting the sanctity of your linux install, linux cannot fsck NTFS, so you have to boot windows and run chkdsk or whatever they have in windows if your file system gets corrupted from a power outage or something. But if you want to try out linux or install linux on a machine that you might want to be able to revert back to its previous form easily it's awesome.


Nitrogen,

This is different from colinux; according to the Wubi FAQ, it's a boot-time-only thing.  What it does is it creates a virtual filesystem inside a regular file on the Windows partition, so no repartitioning is necessary.  But it doesn't run the kernel side-by-side with the Windows kernel.

Ok you two fight it out, I want to know the truth.
On two occasions, I have been asked [by members of Parliament], "Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?" I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a question.
Charles Babbage

zahc

  • friend
  • Senior Member
  • ***
  • Posts: 5,941
Re: Try linux... from within windows!
« Reply #8 on: July 30, 2009, 04:39:23 PM »
We are both right.

I'm not entirely clear on the details; it's a bit of magic to me. I think it runs on a virtual file system, so it thinks it's running a linux filesystem. NTFS file systems aren't bootable from linux afterall, so the linux kernel must have a virtual linux file system to run on. If this virtual filesystem gets buggered, linux can patch it up just fine.

But, said virtual linux file system is running on top of your windows NTFS file system. Notice that there is no disk partitioning that goes on to install using Wubi, making it very safe for the original host OS; as far as Windows is concerned, the linux install is just a big file.

The computer I'm typing from has been Wubi'd, FWIW:

Code: [Select]
cdm071000@ubuntu:/$ sudo fdisk -l
[sudo] password for cdm071000:

Disk /dev/sda: 250.0 GB, 250000000000 bytes
255 heads, 63 sectors/track, 30394 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe686f016

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1           7       56196   de  Dell Utility
/dev/sda2   *           8       30393   244075545    7  HPFS/NTFS
cdm071000@ubuntu:/$



By the way, the name "Wubi" always makes me think of that Donald Fagan song from The Nightfly

I've got a girl and Wubi is her name
Wubi Wubi; Wubi, babie!
Maybe a rare occurence, but then you only have to get murdered once to ruin your whole day.
--Tallpine

BrokenPaw

  • friends
  • Senior Member
  • ***
  • Posts: 1,674
  • Sedit qvi timvit ne non svccederet.
    • ShadowGrove Interpath Ministry
Re: Try linux... from within windows!
« Reply #9 on: July 30, 2009, 05:45:50 PM »
To expand on what zahc said, based upon my own knowledge (Most of this is fact.  The details of the exact implementation within wubi are speculation, but chances are I'm correct):

Linux treats all disk drives (to include USB flash drives, CD/DVD, hard disk partitions, and so forth) as something called "block devices", meaning "devices that blocks of data can be read from (and in most cases, written to) in random order".

In order to be used as a place to store files, a block device has to have a "filesystem" created in it.  That's the thing that tracks were and how big all of your files are, and so forth.  Linux also has the ability to use what's called a "loopback device" to pretend that a file, which exists in another filesystem, is a block device, which can then have its own (possibly different) filesystem built inside it.

What Wubi is doing is mounting the Windows filesystem (NTFS) and creating a file in it.  Then it is attaching that file to a loopback device driver, and thus creating for itself a virtual disk drive within that file.  Then it's creating its own filesystem on top of that virtual disk, and installing Ubuntu on top of that filesystem.

This is an easy way to do this sort of thing, from an end-user standpoint, but it is not a robust one, technically speaking.

The reason it's not robust is because of something that both NTFS and most modern Linux filesystems (including ext3, ext4, xfs, jfs, and reiserfs) do, to prevent data loss in the event of a sudden shutdown.  Data that is to be written to disk is first written in something called a "journal", and then (at periodic intervals) it's flushed from the journal to the actual filesystem.  That means that at no time is there ever a completely inconsistent copy of the data on the disk.  Either it's totally there (though possibly old) in the main store but partially written in the journal, or it's complete in the journal, but not yet fully written to the main store, or it's successfully written to the main store and flushed from the journal.

The problem comes when you layer a journaling filesystem inside a loopback-based file on top of another journaling filesystem; the interior filesystem thinks he's running on a bare disk, but his written blocks may be cached, journaled, and written out of order by the exterior filesystem, because the journal guarantees integrity, not sequentiality. 

So if the internal filesystem (for instance) writes part of a file change from its journal to a file, and flushes that part of its journal, but only the block containing the flushed journal is written to the physical device by the exterior filesystem before power is shut off, you're left with an inconsistent state in the interior filesystem.

This is why you should never ever just shut off any machine that's got a virtual loopback filesystem running on it.

-BP
Seek out wisdom in books, rare manuscripts, and cryptic poems if you will, but seek it also in simple stones and fragile herbs and in the cries of wild birds. Listen to the song of the wind and the roar of water if you would discover magic, for it is here that the old secrets are still preserved.

Jim147

  • friends
  • Senior Member
  • ***
  • Posts: 7,773
Re: Try linux... from within windows!
« Reply #10 on: July 30, 2009, 06:18:15 PM »
i haven't tried the  one your talking about but in the old days =) I used Lin4Win inside Win95. I believe that was a colinux project.
Last year I tried Topologlinux. It ran inside windows on the very slow side but all the drivers worked. It had an option at boot to go straight into linux but the drivers became a pain.

jim
Sometimes we carry more weight then we owe.
And sometimes goes on and on and on.

BAH-WEEP-GRAAAGHNAH WHEEP NI-NI BONG

RevDisk

  • friend
  • Senior Member
  • ***
  • Posts: 12,633
    • RevDisk.net
Re: Try linux... from within windows!
« Reply #11 on: July 30, 2009, 07:26:34 PM »

Still, it's pretty slick.  I remember the days where trying to get a dual-boot system going was an exercise in frustration.


Sigh...  Old computer types.  Next he's gonna be telling us about the old HD platters the size of a washer and how if they got out of sync, you could race them across the datacenter.   Plus entertaining tales involving punch cards.   ;)

Now'a'days, you can run VMware products (or whatnot) to run multiple OS's at the same time.  Screw duel booting!  The niftier products allow you to migrate VM's across multiple machines with no interruptions. 

I like being able to make a 'server' on my desktop, and transfer the VM image to a server later.  Or moving it (or a copy of it) back to my desktop.  I keep a couple OS's running at the same time.   XP or Server 2003 on my laptop as the base, Linux for specialized tools and sterile XP instances for testing.  A bunch of other specialized instances for odd things, but I don't fire 'em up until I need of them.   

Niftiest trick is using USB ethernet devices, and link them to seperate networks.  It's sometimes entertaining to run a computer that is independently linked to half a dozen networks, yet still maintaining seperation.    ;)
"Rev, your picture is in my King James Bible, where Paul talks about "inventors of evil."  Yes, I know you'll take that as a compliment."  - Fistful, possibly highest compliment I've ever received.

tyme

  • expat
  • friend
  • Senior Member
  • ***
  • Posts: 1,056
  • Did you know that dolphins are just gay sharks?
    • TFL Library
Re: Try linux... from within windows!
« Reply #12 on: July 31, 2009, 04:45:06 AM »
I'm going to have to try this out.  The windows bootloader has always been a bit of black magic to me.

Quote from: RevDisk
I like being able to make a 'server' on my desktop, and transfer the VM image to a server later.  Or moving it (or a copy of it) back to my desktop.  I keep a couple OS's running at the same time.   XP or Server 2003 on my laptop as the base, Linux for specialized tools and sterile XP instances for testing.  A bunch of other specialized instances for odd things, but I don't fire 'em up until I need of them.

Do any of your servers do a lot of  I/O, and if so how does that work?  Hardware that actually supports hardware io virtualization (does PCIe 2.0 + core i7 support that)?  Separate controllers reserved for the guest OS?
Support Range Voting.
End Software Patents

"Four people are dead.  There isn't time to talk to the police."  --Sherlock (BBC)

BrokenPaw

  • friends
  • Senior Member
  • ***
  • Posts: 1,674
  • Sedit qvi timvit ne non svccederet.
    • ShadowGrove Interpath Ministry
Re: Try linux... from within windows!
« Reply #13 on: July 31, 2009, 11:46:13 AM »
Now'a'days, you can run VMware products (or whatnot) to run multiple OS's at the same time.  Screw duel booting!  The niftier products allow you to migrate VM's across multiple machines with no interruptions.

We use VMware Lab Manager here, because we have too many permutations of hardware spec, OS type, and OS version, to have instances of each for our engineers and testers to test on.

LabManager's ridiciculously awesome:  You go to a web page, tell it, "I need a virtual machine with 4G of RAM, Red Hat EL5, and a connection to the test lab network.  Go."  Then you go get a cup of coffee, come back, and the virtual machine is all set up and booted, and the console of it appears in your web browser.  You test whatever you like, and then tell LabMan "I'm done", and it de-provisions the thing and returns resources to the pool.
Seek out wisdom in books, rare manuscripts, and cryptic poems if you will, but seek it also in simple stones and fragile herbs and in the cries of wild birds. Listen to the song of the wind and the roar of water if you would discover magic, for it is here that the old secrets are still preserved.

RevDisk

  • friend
  • Senior Member
  • ***
  • Posts: 12,633
    • RevDisk.net
Re: Try linux... from within windows!
« Reply #14 on: July 31, 2009, 01:49:27 PM »

Do any of your servers do a lot of  I/O, and if so how does that work?  Hardware that actually supports hardware io virtualization (does PCIe 2.0 + core i7 support that)?  Separate controllers reserved for the guest OS?

Yes, primarily our database servers.  We keep the primary ones on iron.  Light utilization DB's go on VM.

We have some high i/o on some of our virtualized web servers.   Nothing as nearly harsh as the punishment the DB servers take.  We haven't dedicated controllers out to individual VM's.  Dedicated processors, sure. 

Any more than that has to be by PM.  ;)



We use VMware Lab Manager here, because we have too many permutations of hardware spec, OS type, and OS version, to have instances of each for our engineers and testers to test on.

LabManager's ridiciculously awesome:  You go to a web page, tell it, "I need a virtual machine with 4G of RAM, Red Hat EL5, and a connection to the test lab network.  Go."  Then you go get a cup of coffee, come back, and the virtual machine is all set up and booted, and the console of it appears in your web browser.  You test whatever you like, and then tell LabMan "I'm done", and it de-provisions the thing and returns resources to the pool.

We demo'd LanMan, but didn't pick it up.  Didn't really need it as our hardware and environment is not nearly as diverse as the one you're operating.  Good product, though.
« Last Edit: July 31, 2009, 01:54:33 PM by RevDisk »
"Rev, your picture is in my King James Bible, where Paul talks about "inventors of evil."  Yes, I know you'll take that as a compliment."  - Fistful, possibly highest compliment I've ever received.

Perd Hapley

  • Superstar of the Internet
  • friend
  • Senior Member
  • ***
  • Posts: 62,698
  • My prepositions are on/in
Re: Try linux... from within windows!
« Reply #15 on: July 31, 2009, 10:54:02 PM »
I remember the days where trying to get a dual-boot system going was an exercise in frustration.

I just installed a second HDD in my Win2000 machine, and installed XP on it.  It set up a dual boot, without even asking. 
Can the liberties of a nation be thought secure when we have removed their only firm basis, a conviction in the minds of the people that these liberties are the gift of God?
--Thomas Jefferson

GigaBuist

  • friends
  • Senior Member
  • ***
  • Posts: 4,345
    • http://www.justinbuist.org/blog/
Re: Try linux... from within windows!
« Reply #16 on: July 31, 2009, 11:18:25 PM »
Quote
What Wubi is doing is mounting the Windows filesystem (NTFS) and creating a file in it.  Then it is attaching that file to a loopback device driver, and thus creating for itself a virtual disk drive within that file.  Then it's creating its own filesystem on top of that virtual disk, and installing Ubuntu on top of that filesystem.

I'm guessing this part is speculation.  If it isn't I apologize for suggesting an alternative speculation. :)

I just snagged the installer and fired it up.  I noticed that it requires you to select a disk size at install time, so I'm thinking the NTFS mount and loopback isn't used.  Instead it's probably carving out a 'raw' block of data from the NTFS system at install time and the Linux install is somehow mounting that slice of a partition when it fires up.  Totally unconcerned that it's little pie of raw blocks has been carved out of NTFS.  Now, in order for that to work you'd need to be able to actually carve out a raw chuck from NTFS and I'm not sure you can do that.  I'm also not sure how Linux would mount a slice of an actual partition, but I haven't played with it much in years.  Pure speculation on my part here.

Unless the NTFS write-back capability is WAY more trusted than I remember it being I doubt somebody would try and do the NTFS -> loopback file deal.  Just saying.

I'm tempted to install but if somebody that has it could post the results from the 'mount' command that'd really clue us into how this works.

All that said, it's funny, but this isn't a new idea.  There was a trimmed down version of Slackware back around 1998 that I ran called ZipSlack.  The install was under 100MB and was targeted so that you could just unpack the zip file into a Zip drive and fire it up.  That was back in the Windows 95/98 days of course.  With that kernel you could still get into the, oh I forget, what the machine-level privileged escalation is called, but you could basically dump everything out and just start over while the host OS was running and LOADLIN would replace the system with a Linux kernel.  From there it'd mount the directory you installed it to as a quasi-FAT32 filesystem called UMSDOS that basically slapped Unix-type permissions on top of FAT32.  It was neat because you could play with the contents of your 'Linux' disk even when booted up to Windows.

Crude, but it worked well enough to get you into a Linux environment and learn about it without worrying about trying to repartition an existing disk.

Hawkmoon

  • friend
  • Senior Member
  • ***
  • Posts: 28,194
Re: Try linux... from within windows!
« Reply #17 on: July 31, 2009, 11:24:52 PM »
Niftiest trick is using USB ethernet devices, and link them to seperate networks.  It's sometimes entertaining to run a computer that is independently linked to half a dozen networks, yet still maintaining seperation.    ;)

Ummmm ... yeah. RIGHT!


?????
- - - - - - - - - - - - -
100% Politically Incorrect by Design

tyme

  • expat
  • friend
  • Senior Member
  • ***
  • Posts: 1,056
  • Did you know that dolphins are just gay sharks?
    • TFL Library
Re: Try linux... from within windows!
« Reply #18 on: August 01, 2009, 07:55:29 PM »
Quote from: GigaBuist
Unless the NTFS write-back capability is WAY more trusted than I remember it being I doubt somebody would try and do the NTFS -> loopback file deal.  Just saying.

ntfs-3g via FUSE is quite usable and stable.  The in-kernel driver still sucks, afaik.

Quote from: revdisk
We have some high i/o on some of our virtualized web servers.   Nothing as nearly harsh as the punishment the DB servers take.  We haven't dedicated controllers out to individual VM's.  Dedicated processors, sure.

Yeah, I was just trying to confirm what I've heard, which is that most larger organizations are using VMs when they have lots of servers that mostly sit near-idle (at least in terms of disk io), while heavily loaded systems still get their own hardware.  Seems to match your description.
Support Range Voting.
End Software Patents

"Four people are dead.  There isn't time to talk to the police."  --Sherlock (BBC)

RevDisk

  • friend
  • Senior Member
  • ***
  • Posts: 12,633
    • RevDisk.net
Re: Try linux... from within windows!
« Reply #19 on: August 01, 2009, 09:30:42 PM »
Ummmm ... yeah. RIGHT!


?????

Basically, know how you have a wire going from your PC to the wall that allows you to connect to APS?  That puts you on a network, and that network has certain properties.  Sorta like a road.

Visualize having six different 'roads' to get to APS. 
"Rev, your picture is in my King James Bible, where Paul talks about "inventors of evil."  Yes, I know you'll take that as a compliment."  - Fistful, possibly highest compliment I've ever received.