SUSE Blog

Make Windows green again – Part 1

Hannes Kühnemund

By: Hannes Kühnemund

January 12, 2017 11:34 am

Reads:51,788

Comments:15

Score:4.83

Print/PDF

Install openSUSE Leap 42.2 in WSL

wsl_blog_1_1

[UPDATE]: We are done, openSUSE Leap and SLES are available in the Windows 10 Store. So head directly to Part 6 – The Grande Finale of this blog series to find out how to Make Windows finally green again! 😉 If you are interested in the historical details, feel absolutely free to continue reading.

It was November 28, 2016 when I came across an article on TechRepublic which talked about Microsoft’s plans for the future of Linux and Bash on Windows 10. The first read made me feel uncomfortable (I can’t really say why) but after the second read I started believing that this is in fact a great opportunity. Running Linux binaries natively on Windows … that sounds awesome indeed. However, it’s quite unfortunate that Microsoft enabled the wrong Linux (that’s my personal opinion) by default within the Windows Subsystem for Linux (WSL) and it is time to change it to the real stuff.

If you are one of those people who says: “Wait a second, I’m running SUSE Linux on my desktop / laptop already and I’m not using Windows 10 by any means” then you might want to stop reading now because you are already there. But we cannot neglect the reality that Windows is running on most of those devices and it’s hard to have both Windows and Linux truly accessible at the same time. You’d either have to go with a dual boot setup, or you may leverage virtualization and run a Linux VM on Windows (or vice versa), or you might be familiar with Cygwin allowing you to run recompiled Linux binaries on Windows. All of those options have their advantages and disadvantages – so do we need another one?

Yes, we do. But we need one; the integrated one leveraging the green Linux from SUSE. Why SUSE? Well, SUSE knows what they are doing because they have been in the Linux business since 1992. Try to find a Linux “vendor” (or in that sense, distributor) which is older. You won’t. There aren’t any. OK, enough with the self-praise. Let’s get started.

Assuming that you are running Windows 10 already, there are simple steps you have to follow to install a SUSE Linux distribution inside WSL (as always, I’m sure there are easier ways to achieve the same. Feel free to use the comment function to let everyone know how you do it differently). You have currently two options, openSUSE Leap 42.2 and SUSE Linux Enterprise Server 12 SP2. I’ll describe the process for openSUSE Leap 42.2 below (it works the same way for SUSE Linux Enterprise Server 12 SP2, just with another archive to download and extract):

  • Download the openSUSE docker userspace:
    $ wget -O openSUSE-42.2.tar.xz https://github.com/openSUSE/docker-containers-build/blob/openSUSE-42.2/docker/openSUSE-42.2.tar.xz?raw=true
  • Open the bash shell, which you find in your Windows Start menu under “Bash on Ubuntu on Windows” (click the Windows button, type “bash” and then hit Enter). True, it’s still Ubuntu but we only need to run a few commands there before we can replace it.
  • Extract the openSUSE userspace (ignore any warnings) and exit the bash shell:
    $ sudo mkdir rootfs
    $ sudo tar -C rootfs -Jxf openSUSE-42.2.tar.xz
    $ exit
  • Backup the old rootfs (Ubuntu) and copy the new openSUSE rootfs. Open a Command Prompt window (Windows key, enter “cmd” and hit Enter) and run the following commands:
    cd %localappdata%\lxss\
    rename rootfs rootfs.ubuntu
    move .\home\<linux_user>\rootfs .\
  • The new openSUSE userspace will, of course, not include the user that you created when you installed Bash for Windows, nor does it have things like ‘sudo’. To start just set ‘root’ as the default user. While still in the Command Prompt window run the following:
    lxrun /setdefaultuser root

    When exiting the command prompt, start bash from the start menu (Windows key, enter “bash” and hit Enter) and you have your openSUSE Leap 42.2 environment running within WSL.

  • Now let’s also change the orange icon to a cool green one. The one I’m using is coming from iconarchive.com and can be found through this link: http://www.iconarchive.com/show/nuoveXT-icons-by-saki/Apps-suse-icon.html
    Download the .ico file and copy it to %localappdata%\lxss\. In a command shell execute the commands (or simply use Windows Explorer, whichever suits you best):

    cd %localappdata%\lxss\
    rename bash.ico Ubuntu.ico
    rename Saki-NuoveXT-Apps-suse.ico bash.ico

Now you’re done. Without a reboot, the Windows start menu continues to show the old, orange icon. You could rebuild the start menu index or just wait until your next reboot. If anyone knows how to update the icon which is shown when using the search (Windows button, enter “bash”), let me know.

Last but not least, let’s navigate to %AppData%\Microsoft\Windows\Start Menu\Programs and give the entry a proper name. I called the entry “Bash on SUSE on Windows”.

wsl_blog_1_2

So now that we have – in my opinion – the proper Linux placed inside the WSL, it is time to do a little more with it. Let’s take a look into getting the user setup straight with part 2.

You can follow me on Twitter (@hakuehnemund) or on LinkedIn.

Table of contents:

12 votes, average: 4.83 out of 512 votes, average: 4.83 out of 512 votes, average: 4.83 out of 512 votes, average: 4.83 out of 512 votes, average: 4.83 out of 5 (12 votes, average: 4.83 out of 5)
You need to be a registered member to rate this post.
Loading...

Tags: , ,
Categories: Enterprise Linux, openSUSE, SUSE Linux Enterprise Server, Technical Solutions

Disclaimer: As with everything else in the SUSE Blog, this content is definitely not supported by SUSE (so don't even think of calling Support if you try something and it blows up).  It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test, test, test before you do anything drastic with it.

15 Comments

    • By:Hannes Kühnemund

      Hi ealin,

      thanks for the hint and the URL. I know this tool too, but thought it is a little bit too complex for what I wanted to do.

      For anyone running / and switching between multiple distributions within WSL, the distribution switcher might be a good fit.

      I for myself use bat files to rename and manage the rootfs.xxx folders.

      Regards, Hannes

  1. By:dvosburg

    This is really cool – and I will definitely be trying it this weekend! Thanks, Hannes!

  2. By:roelandjansen

    Hannes,

    I believe that this may do the trick:

    http://www.askvg.com/how-to-change-icons-and-text-labels-names-of-start-screen-tiles-in-windows-8/

    Furthermore — just like the ubuntu version quite a few things cannot be done due to constraints but hey it’s cute 😉

  3. By:roelandjansen

    ok. above works. I changed the props to an suse icon and named ‘bash”

  4. By:shamim_gmail

    How do I do this with sudo?

    One of the features I rely on in Linux that Windows doesn’t have is true separation of concerns. That being said, I don’t login as root to do anything unless it’s a critical system crash or the problem requires elevated root privileges as well as the root environment. Not having sudo under LInux feels inherently wrong.

    Thanks.

  5. By:Hannes Kühnemund

    Quick heads up, I received a question about missing sudo and the situation, that the default users right now is root. I can assure you, that all of that (+ X Windows) is handled within part 2 of this blog series.

  6. By:victorhck

    Hello!

    I stop read after:

    “Wait a second, I’m running SUSE Linux on my desktop / laptop already and I’m not using Windows 10 by any means”

    Just kidding! 🙂

    I’m not a Windows user, but I find this interesting… I’ll wait the 2nd part!

    ‘ve phun!

  7. By:Magl72

    Thank you. I’ll wait for the second part

  8. By:Hannes Kühnemund

    Part 2 has just been released. All graphical stuff will be discussed in part 3, as the user setup filled part 2 completely.

  9. By:drobb

    Hannes,
    This is fantastic. I work with SUSE and openSUSE all day long, now I can have it on my Windows 10 Desktop too. looking forward to part 4.

Comment

RSS