Pages

Saturday, 14 September 2024

How to Install Ubuntu Linux without a DVD or USB


USB memory sticks are replacing the DVD as the go to method of installing Linux, but what if you find yourself in that rare situation of having access to neither? There is a way, and even if you don’t particularly need it, it’s a great learning experience that could come in handy.

What you don’t need is a DVD or an USB drive. What you do need is an existing Windows installation and access to the internet, plus the following:

  1. A partitioning tool
  2. A couple of files for booting an Ubuntu installer
  3. Ext2Fsd
  4. EasyBCD

This is the process in a nutshell:

  1. Make the Linux partitions with the partitioning tool
  2. Make the Linux partition available in Windows with Ext2Fsd
  3. Download and copy the boot files to the /boot directory on the new Linux partition
  4. Install a bootloader that will boot with these files using EasyBCD
  5. Install Ubuntu

1. Making partitions

You can use any good partitioning tool for this, like Partition Magic or AOMEI Partition Assistant Home Edition. The key is to have some unused space on your hard drive where you can put the Linux partitions. If you don’t you can resize an existing partition to make space and then create a new partition in the newly unused space.

This isn’t the partitioning guide, but while you do need to be careful not to nuke the wrong thing with this the process is ultimately really simple. Both of the mentioned tools, for example, present things visually in a way that makes it hard to do something stupid like, say, erase your C:/ where your Windows is installed.

What you need to create are two partitions. One should be around 15GB to 20GB or more, of the ext4 type, and the other should be 512MB to 1024MB as a swap partition.

You should end up having something like this:

Linux partitions

The selected partition is the Linux partition, and the “Unformatted” one is used as swap. It doesn’t need to be formatted as Linux does that automatically. You just need to tell it what to use as swap.

Once you’ve got these partitions ready you can move on to the next step.

2. Make the Linux partition available in Windows

Windows can’t read Linux partitions on its own, as it doesn’t support the Ext3 or Ext4 partitions (nor most of the others). It doesn’t have the drivers for it. That’s where Ext2Fsd comes in. It’s the driver that allows Windows to read and write to Ext3 and Ext4 partitions.

Download it, install it, and you should have an Ext2 Volume Manager among your apps. Launch that, and if your new Ext3 partition isn’t visible in your Windows Explorer already you can double click on it in Ext2 Volume Manager and set a mountpoint for it. It should look something like this:

Ext Volume Manager

You may have to reboot after hitting Apply. And then you can proceed to copying some files on the newly available Linux partition.

3. Copy boot files

Go to the Ubuntu netboot archive, click on the desired Ubuntu version (like Ubuntu 14.10 (Utopic Unicorn) at the time of this writing), then your processor architecture (like amd64 or i386 depending on whether you’re on a 64bit or 32bit system), then the ubuntu-installer folder, and the amd64 or i386 in it. Finally you should be on a path like this: /ubuntu/dists/utopic/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64

There you need to download two files: initrd.gz and linux. They’re quite small.

When you have these go to your new Linux partition, create a “boot” directory on it, and put those files there.

Now you’ve got a simple boot environment set up. What these two files contain are, in fact, the Ubuntu installer and the boot process for it!

4. Install a bootloader with EasyBCD

NeoSmart offers this super smart tool called EasyBCD that allows you to install bootloaders to boot just about anything. To download it go to the EasyBCD website, scroll down, and you should see the option to Register to download for free, or buy the program. The free version is for non-commercial use only.

EasyBCD

Once you’ve downloaded, installed, and launched EasyBCD you can see the existing bootloader settings. You just need to follow these simple steps to add a bootloader for our new Ubuntu install boot that we’ve set up in a previous step:

  1. Click “Add New Entry”, and switch to the “Linux/BSD” tab
  2. In the “Type” drop down select GRUB2. Set “Name” to whatever you want (“Ubuntu” or “Linux” would make sense). And just make sure the “Drive” drop down is set to “Automatically locate and load”.
  3. Click “Add Entry”, and then press the “BCD Deployment” button on the left.
  4. Make sure “Install the Windows Vista/7 bootloader” is selected, or Windows XP bootloader if you use that, and then click “Write MBR”.

That should give you a working bootloader with two options; the standard Windows option, and the new Linux boot option that should get you installing Ubuntu. It loads an AutoNeoGrub utility that scans your partitions for the Linux boot files like the ones we set up.

If for some reason it fails to find it you can go back to BCD and add a new NeoGrub entry where you can specify the exact location of your boot files.

Just go to Add New Entry as above, and then to the NeoGrub tab. There click the Install button, and then the Configure button to open the configuration file.

In the configuration file add these lines:

title Ubuntu
find --set-root /boot/linux
kernel /boot/linux ro root=/dev/sda5
initrd /boot/initrd.gz</code><code>title Ubuntu 2
root (hd0,4)
kernel /boot/linux
initrd /boot/initrd.gz

This will give you two options when you boot into NeoGrub, and one of them should work. Make sure to replace /dev/sda5 and (hd0,4) with the location of your Linux partition. You can check Ext2 Volume Manager mentioned before for the right number of your partition. In the (hd0,4) entry it counts from zero so if it is the Volume5 it should be (hd0,4), and if it is Volume4 it should be (hd0,3) while the /dev/sda5 entry corresponds to Volume5.

Chances are you wont need these manually added entries, and that the automatic AutoNeoGrub entry added before will find your boot files right away and boot them when you reboot.

5. Reboot into the Ubuntu installer

After rebooting you should see a choice between Windows, Linux, and NeoGrub if you’ve added the manual lines. Select “Linux” (or whatever you called it), and it should reboot into Ubuntu install.

6. Install Ubuntu

This is the stanard text graphics based installer that will ask you for your language, location, keyboard mapping, timezone, and install a base system. You can then choose to install extra software on top of it, like Ubuntu Desktop for a full Ubuntu installation.

The details of the install process is beyond the scope of this article. Just make sure that when you get to the partitioning step you choose “Manual” so you can select your Linux and swap partitions to install on instead of overwriting your entire hard drive!

Ubuntu will install its own GRUB bootloader during setup, and it will contain the Windows boot option as well so you should at this point have a dual boot setup on your PC between Windows and Ubuntu.

 from https://web.archive.org/web/20231209172537/https://www.nuxified.org/article/how-install-ubuntu-linux-without-dvd-or-usb/

No comments:

Post a Comment