Wednesday, April 27, 2016

How to install Ubuntu 16.04 LTS inside Windows without partitioning

Linux without the hassle of partitioning. How to do it? Here is the answer. You can uninstall whenever you want!


Linux is a blessing to the mankind. It has a sense of freedom in its licenses -- no nagging, no spying, no privacy breaches -- only pure computing experience. I like linux myself, if you do not, I will not judge you. You have the freedom to choose. You are quite the same if you like coffee or you like tea. I can't judge you based on what you like.

But before you choose, I urge you to see two videos: First one and Second one.

Install inside Windows

Install inside Windows is a special feature that let's you install Ubuntu on your Windows. It will sit right on your Add/Remove Programs, just like any other program. You can uninstall it anytime you wish, if you don't like it. You will not need to repartition the hard disk. So you can safely try it on your computer.

There is one small limitation to this method. The drive you install Ubuntu into will be safe. But you will not be able to access that drive from within Ubuntu. (That's why I like to choose C: drive because there is usually nothing useful in C: drive. I keep my documents on other drives, I don't keep important things on the desktop... So I feel okey with this.)
[ UPDATE: It seems I may be wrong. You can access the drive you install into, from /host directory. Details are in the comments section in the comments by Nessie. ]

A word of Caution. To install inside Windows we need Wubi. Wubi is deprecated from official release of Ubuntu since 14.04. We will use an unofficial release of Wubi to install it. I have not created the software, so I am not responsible for any damages. (I have not seen any damage so far, but it is a thing to keep in mind.) Although you can make the modifications yourself but it a bit difficult task to do. Details here.

Also, please use caution when selecting the pendrive drives or hard disk drives, because that may change what you would want to do and you might install the wrong thing on the wrong drive!

It is always recommended to keep a backup of all your data even if it's not needed. I will not be responsible for any loss of data.

Requirements:

1. 1 pendrive, 2 gb or more in capacity (FAT32 formatted, usually every pendrive is, so maybe you are okey on that)
2. 8 gb or more (16+ gb recommended) empty space on harddrive (preferrably on C: drive)
3. Ubuntu 16.04 32bit ISO named ubuntu-16.04-desktop-i386.iso ( Download here )... you can also try the 64bit (x86_64)... but I haven't.
4. LiLi USB Creator ( Download )
5. Wubi 16.04 by hakuna_matata. Go to this link or this link. Download the latest file for 16.04, for example, mine was "wubi1604r301.exe".

The required time may vary based on expertise -- approximately 30 minutes to 1 hour.
Everything is easy (compared to partitioning on other methods). Additionally, every step is detailed in this article. So I guess difficulty level is easy.

Step - 1: Preparing the pendrive (or media)

You will need a pendrive. 2 gb or more in storage to create a temporary medium for the install. You will be able to use the pendrive normally, for any other purpose, after the install.

First install LiLi USB Creator.

Insert the pendrive in your computer's USB port.

Run LiLi USB Creator. Press yes to give it admin privilege.

Under Step 1, select your pendrive. Please be sure that it is the right pendrive that you selected, because it may be harmful if you choose the wrong drive or a hard disk.



For Step 2, click on the ISO/IMG/ZIP button and browse to select the Ubuntu 16.04 ISO file. It will some time to scan the file. After the scan it may appear as 15.04 but it's okey.



On Step 3, leave the settings to 0 MB as it is, because we will not need anything to be saved for now on our pendrive. (If you want a pendrive version of Ubuntu, then you can enter a value less than 4gb and use it on any computer! You can take Ubuntu with you to any computer and work from there! But it is not as fast and stable as Hard disk install.)



On Step 4, you can keep the format option unchecked to keep your existing files on pendrive intact. You can uncheck all the options in this step as you wish.



Finally, click on the Lightning icon to install Ubuntu on the pendrive.



Now give it some time to install.

After the job finishes you will see a success message.


You can now close the LiLi Window by clicking the cross button at the top right.



Step - 2: Prepping and running Wubi

Go to your pendrive.

Go to casper forlder. Copy the "vmlinuz". Rename the copied file (probably it will be copied as "vmlinuz - Copy") into "vmlinuz.efi"



Go back to go to pendrive again.

Copy the wubi-xxx.exe file in the drive. Rename the Wubi exe file as "wubi.exe".



Now click on the blank space of the address bar at the top.



Now write something like this:

K:\wubi.exe --force-wubi
(Replace K:\ with your pendrive volume letter.)

Without the --force-wubi part it will not give you "Install inside Windows" option that we'll need.

It may ask for admin priviledges. Press yes.


Step - 3: Installing Ubuntu with Wubi

Now you will see a Wubi window appear with a "Install inside Windows" Button. Press that button.



Now is the main part of the setup. Choose the destination drive (I choose C: drive). Choose the capacity that the Ubuntu can take for itself (I choose 16gb or preferrably more). Set a password. Don't bother with the username (that causes some problem, I saw from experience.).



When you choose to click Install, it will start to install Ubuntu on the drive. Give it some time.




After it finishes, this screen will appear and Manually reboot option will be selected. Select Reboot now and Click Finish.

Quickly unplug the pendrive before the computer restarts.

After restart it will automatically boot to Ubuntu. But don't be scared, your Windows is still there. Ubuntu is running because the installation is yet to be completed.

The installation will take some time... around 20 minutes, plus or minus. Then it will automatically restart.

Step - 4: How to Enter into Ubuntu

Upon restart (or starting computer) you will be prompted to either choose Windows or Ubuntu. This screen will appear everytime you start your computer. But it is automatically set to load Windows. And the timer is also set to a lower time, so you will not be bothered with this selection. You will feel almost as it was without Ubuntu.

Choose Ubuntu (with arrow keys and pressing enter).

It will then restart to run Ubuntu. Now after waiting for some time, you should be on Ubuntu Desktop!


Uninstalling "Ubuntu inside Windows"


You will feel like a pro setting up Ubuntu this way! With these easy steps you can run Ubuntu and join the craze.

It's that easy to install and so easy to uninstall. If you don't like Ubuntu the way it is or maybe thinking of installing Ubuntu permanently on a specific partition, you can uninstall it.

Just go to your Control Panel or Computer and navigate to the "Add Remove Programs or features" option. You will find an item named "Ubuntu". Right click on it and select "Uninstall/Change"



You will be prompted with a window showing an option to uninstall. Simply click the Uninstall button to uninstall. It is that easy!



Conclusion

I have not tried this with other Ubuntu flavors such as, Kubuntu, Xubuntu, Lubuntu, Ubuntu Gnome, Ubuntu Mate. But I hope it should work. Now there you have it! An Ubuntu installation without the hassle of partitioning. Now enjoy the power of open source with maximum ease!

What happens with the pendrive you prepared?! Well, it is a bonus! It also has Ubuntu installed inside it! If you have selected a space for persistent data, then you can use that space to store your settings and softwares installed on that pendrive version of Ubuntu! (But do not use the install option inside that. It will wipe your hard disk if you use it the wrong way!) This way is fun to use, but unfortunately it is not of high performance. You should rather try F2FS if you want to run Linux from pendrive.

If you want to get your pendrive back the way it was, just double click on the Remove_lili.bat on Windows and follow the instructions to uninstall Ubuntu from your pendrive. (This is why I love LiLi, it has an uninstall option.)

With the Wind0w$ Ten spying on us on every second and sending every keystroke automatically to Microsoft, it is a breath of fresh air when I can run Ubuntu. But it's just my personal feeling!

Hope you have a great day. If you have any problems let me know in the comments section. Thank you.

14 comments:

  1. Thank you for your how-to.

    Some additional notes which I found:
    > But you will not be able to access that drive from within Ubuntu.
    The Windows drive with Ubuntu is always mounted at /host and access is possible.
    > 5. Wubi 16.04 by hakuna_matata. Go to this link.
    Latest version is available here: https://github.com/hakuna-m/wubiuefi/wiki#releases

    ReplyDelete
  2. ...and one question:
    Why do you need a pendrive and LiLi ? Wubi can install iso files, too. Just copy the downloaded iso in the same folder together with the matching wubi.exe and run wubi.exe. If wubi.exe is outside the iso file --force-wubi is not needed. Maybe --32bit makes sense if you downloaded the 32 bit version and your computer has a 64 bit CPU.

    It should be also possible to download the wubi.exe only, run it and the wubi.exe downloads the matching iso automatically. But sometimes download links are not available and it uses the torrents by default which is slower than downloading the iso images directly.

    ReplyDelete
    Replies
    1. I don't get this, every time want to install it (inside Windows) it starts downloading the 64 bit iso via torrent!! My pc runs on 32 bit (for almost a decade now) and I have even placed another copy of the 32 bit iso file that I've downloaded in the pen drive after reading this particular comment, still no use!!

      Delete
    2. That's strange altogether! This should not happen. Although I have never tried to let it download ISO itself. There may be a bug in the WUBI code.

      Can you try with LiLi with the 32 bit ISO being installed on the USB drive? Try to follow the tutorial to see if it works. If not, let me know and we'll see what can be done! Hopefully, a solution can be discovered.

      Good luck.

      Delete
    3. Only one thing worked, a new 64 bit (LTS) ISO, LiLi, Wubi like u directed on this post. Using it now, a bit slow (maybe bcoz of my ancient config) but stable.

      Delete
  3. Thanks a lot Nessie, this is great info. I will update the link and do some edits.

    For the question, I heard about installing with the ISO file. But I faced a problem with the vmlinuz file being also available as vmlinuz.efi in a machine. (This may be due to UEFI in the board.) Copying a file and renaming it is easy when you have extracted the iso in the pendrive, but not as easy as editing it with 7-zip. Also, it may lose the integrity of the ISO. So I followed this method. I tried to make this so that everyone can run Ubuntu for sure. But anyway, I'll try again with your method and update.

    Thanks a bunch. I learned a lot from you.

    Sincerely
    Adnan

    ReplyDelete
    Replies
    1. Thanks for your reply.

      In the past, I also got sometimes vmlinuz/vmlinuz.efi errors. But I found the following information. The 64 bit version of newer Ubuntus contains a vmlinuz.efi and the 32 bit version contains a vmlinuz . The vmlinux.efi works also on non-UEFI systems with a 64 bit CPU. So the vmlinuz/vmlinuz.efi issue is a 32 bit/64 bit issue with existing solutions:

      https://wiki.ubuntu.com/WubiGuide#Can_I_force_Wubi_to_download_and_install_a_32_bit_version_of_Ubuntu.3F

      I am not sure if "place it in the same folder as Wubi.exe OR start Wubi from the command prompt with the "--32bit" argument." still works but "place it ...." AND "start Wubi ...." worked for me.

      BR,
      Nessie

      Delete
    2. Fascinating! I see that you are a bigger fan of WUBI than I am!!

      No problem. I am leaving a reference to your comment on the blog post. You have amazing insight to this. Thanks.

      Delete
  4. Replies
    1. It was not like this before, when it was officially supported. So we need these extra steps. Ubuntu should've kept it. It is a nice feature.

      Delete
  5. I am getting error like this

    "An error occured

    Cannot download the metalink and thererfore the ISO

    For more information, pleaase see the log file:
    c:\users\lucky-~1\appdata\local\temp\wubi-16.04-rev300.log

    ReplyDelete
    Replies
    1. Hello
      Thanks for reading.

      It is trying to download the ISO - which normally should not happen.

      I guess you have not put the wubi.exe in the pendrive correctly. If you have put the exe in the correctly prepared pendrive, it should not need to download the ISO and should automatically find the files needed. Also, please download wubi only for 16.04, not the latest (i.e. 17.10)

      Please try again with the instructions above. Ask anything if you are not clear, and I'll be happy to help you.
      Regards.

      Delete