Tag Archives: Jessie

Pulling the plug (on Windows10) and moving to Linux on my desktop

If you have followed my recent posts, you know I am working on this experiment on what it takes to wean myself off non Open Source OSes. Over the past weekend I decided it was time to walk the talk and pull the plug on Windows 10 on my Desktop. To be honest, it is not possible for me to avoid Windows 10 because my current Dev platform at work is heavily dependent on Windows (and Visual Studio), but the experiment is to see if I can avoid using Windows/OSX when not working and for my hobbies. So far there are some glaring gaps in my requirements (that I know have solutions but), I used to skirt them by going back to Windows, so I decided lets pull the plug and then figure out how to solve those issues. So here’s how I went about it.

Virtualizing current Windows system

I wanted to convert my current desktop into a VM and then pave the machine to run Debian Jessie. Luckily I have two Disks – a 250 Gig SSD for OS and software and a 1TB HDD. This makes things really easy. If you don’t have a second disk, have a spare external disk with lots of free space.

Using Disk2vhd to create VHDs out of your current Windows system

Turns out Microsoft (Sysinternals) has a fabulous little utility called Disk2vhd.

Download it-> run it -> point it to the Disks that you want to convert to VDHs and provide an output folder. Default output folder is where you are running the util from.

I planned to created Virtual Box VM out of my VHDs, but it supports VHDX only in readonly mode, so I unchecked the ‘VHDX’ option in Disk2Vhd before I initiated the creation so that I can use the VHD directly in Virtual Box on Linux.

Note: If you used the D: of your system for storing files it’s worth including it in the VHD. I made the mistake of not including it, and as a result later with Windows started up, it was iffy about OneDrive, because I had moved all my account folders to the D:. There is no data loss but just that you’ll have to run some hoops to get the VM doing exactly as it was on the Desktop.

Once the VHD creation is complete, you are good to go. This is actually a very good way of backing Windows up, wonder why I didn’t do it more often in the past. Anyway, done now.

Installing Debian with KDE Plasma

In the past I have played around with Cinnamon as my Desktop of choice, though on the laptop I installed Cinnamon and KDE. In such a setup Cinnamon was the default but it had KDE apps around. This time I wanted to go all KDE and see their Plasma desktop in action. So I installed KDE only when asked for choice of Desktops.

When I logged in the first time I was very impressed with how smooth the Desktop experience was. It has elements of Windows, OSX and Gnome in it, but it is really really refreshing.

Cinnamon supports all the Windows shortcuts by default like WinKey to bring up Start Menu, WinKey + E for File Explorer and so on. KDE seems to need a bit tweaking to get it to work like Windows, maybe it has OSX keys by default, not sure. Anyway, I was easily able to support Winkey + Left or Winkey + Right for window align and WinKey + R for bringing up the Application Search. WinKey doesn’t bring up anything on its own though (yet).

Though Konqueror is the default Browser on KDE, I setup IceWeasel (Firefox for Debian) as my default.

I think I like Plasma, but time will tell if it’s just the new fangled toy syndrome or if it will actually help be more efficent than Windows or OSX.

Restoring Windows and a major SNAFU

Once I got Debian going I set it up using the steps in my previous posts. That went smooth.

I followed the official Debian documentation to install VirtualBox.

On VirtualBox I created a new VM and selected ’64Bit Windows 8.1′ and pointed it to the VHD I had created using Disk2Vhd earlier. (I did make a copy of the original VHD knowing its the only way to get back my Windows Machine if anything went south). I had to give the VM 8 Gigs of RAM and selected ICH9 chipset for Windows to recognize the Sound Card correctly.

However after Windows 10 re-initialized itself and came back, it refused to activate saying the ID had been blocked. Now I didn’t put in a Key for Windows 10 specifically, I had upgraded from Windows 8.1. But Windows kept refusing to recognize the 8.1 Key. So currently I have a working VM that’s not activated. This possible means I’ll have to repave the entire machine and go back to Windows 8.1 (which wouldn’t be so bad actually). But that’s for another day. This is just a heads up, Microsoft doesn’t really want you to move your Windows license anywhere other than where its installed even if it happens to be the same machine where you had it initially. This is the type … oh well, I promised myself I wouldn’t rant, so stop.

Replacing OneDrive

A cloud synced storage platform is the only thing I need to do my work efficiently. While I could easily use DropBox as a paid replacement for OneDrive, I lost bit of faith in DropBox with their policy changes in the past.

So I am working on a little project of my own that allows me to maintain a cloud repository of important files (mostly pictures of scenery I capture ;-)…) . It’s tentatively called KalliopeSync and uses Azure (I know about the irony) Blob storage at the moment.

The cost of using Azure Blob Storage for my files is less than to cost of a latte per month. So I tell myself on a random day of the month, that today I am paying for my cloud storage and skip the latte ;-). There you go, free cloud storage 🙂 🙂 :-).

It adds to my long list of personal projects, and yes, this CommitStrip is meant for me, but hey, its the idea that counts… or maybe not, whatever!

Looking ahead

I am hoping, by forcing myself to move out of my comfort zone I will be able to explore Linux more and help me expand my toolbox of Web Development tools/technologies and platforms.

I don’t hate Microsoft or anything, just that with Windows 10 we’ve come to an ideological crossroad that forces me to take the path less traversed. If Windows ever came with a “Leave me alone” button that, in a single click, transferred ownership of my computer and data back to me, I would happily pay for it and use it. Till such time …

P.S. I will miss Live Writer… hope it gets open-sourced some day…

Tagged , ,

Linux on Mac Update 1: Fixing Kernel Panic issues in Debian Jessie

In my previous articles I had explained how I installed Debian Jessie on my Macbook Pro and set it up to do .NET work. I had mentioned in the same about some crashes I had encountered. At the time of writing that, the crashes had seemed one-off and manageable, but soon after things changed drastically.

I had kernel panic issues almost every 15 minutes of use.

I just couldn’t figure out why. In desperation I un-installed the Broadcomm drivers for wireless. This may have helped a trifle in the sense I had crashes every 30 minutes instead of 15. Again it could be the change didn’t make any difference at all.

Most searches pointed to hardware issues. I ran memtest from a bootable USB, fearing the worst, but that passed too.

Now I was getting desperate. Only other ‘hardware’ thing left to do was change the thermal paste on the CPU/GPU failing which, abandon Linux.

Unwilling to accept that, I continued my search and finally hit a few forums where they suggested using Nvidia drivers instead of noveau that comes with default. Thing with Nvidia drivers is that… well they are from Nvidia and hence not ‘free’ as in GPL compliant. But I was desperate to continue using Linux so I went ahead and installed Nvidia drivers as follows:

1. Add the non-free repository URL to apt-get (Skipped this step actually since I already had it added while installing Broadcom drivers earlier, so if you have installed any packages from the non-free repository you don’t need to do this step)

sudo nano /etc/apt/sources.list deb http://http.debian.net/debian/ jessie main contrib non-free
sudo apt-get update

2. Install the following packages

sudo apt-get install nvidia-glx nvidia-kernel-dkms nvidia-xconfig nvidia-settings

3. Setup Nvidia conf for Xorg if you have Gnome shell

sudo nvidia-xconfig

4. Reboot

End Result

Well it’s been a couple of hours now, and the system hasn’t frozen. I’ve done all the things I did with it earlier to see if it freezes e.g. use MonoDevelop, Run TypeScript compiler, use IceWeasel, use Terminal, put it off to sleep, close lid, reopen lid, let it go to screen saver and wake it from screensaver and it has survived it all. I am going to keep it like this for the night and install the wireless drivers in the morning. If it survives that I’ll consider this issue ‘resolved’.

Minor Crib

After installing Nvidia drivers I seem to have lost screen brightness control functions via F1 and F2 buttons. Thought F5 to F12 work (keyboard backlight + multimedia and sound buttons). This would have been okay if Nvidia drivers had not came up with the brightest settings possible for the screen. Had to go into Nvidia’s control panel and dial it down a few notches to stop it from burning my retina 🙂

Left on overnight…

I am very happy to report that the system ran peacefully last night. I managed to configure IceDove to get all my emails and left it on overnight. IceDove managed to get 12 years worth of email headers overnight and there was no Kernel panic. IceDove did run in a tight loop when getting emails so temperatures went soaring and the CPU Fan was hissing angrily for a long time. This nearly confirms the Kernel Panic under stress/high CPU temperatures is not ‘the’ issue. Up next wireless drivers (again), will update back in a few hours.

And the wireless drivers are back…

Well, its been a few hours of running the wireless drivers. Still no issues. Though the computer has been idle most of this time. Other than trying out some themes online, I haven’t done much on it. But I’ve never had this much stability for so long. It used to crash before this. Well then, I’ll mark this issue as resolved!

Up next setting up TRIM for your SSD… I need to look this one up though, not sure you still need it in Jessie!

Tagged , , ,

Getting your Debian Jessie System Ready for .NET work

As a followup to my last post I thought I would continue with my ‘learnings’ on how to go about using Linux. It hasn’t been all sunshine and bunny rabbits. I’ve had multiple crashes and one was so bad I had to re-do the entire OS installation again. I have a nagging feeling it had something to with me trying to install developer dependencies over a dodgy wifi network on the train ;-), I shall not  try that one again to confirm.  There were a couple of secondary crashes that were pretty bad too. I am close to concluding that’s because my laptop’s heating system is botched and I really need to take it apart and reapply the cement for better heat dissipation. Second suspect is the Broadcom wireless driver. Also the ‘close lid’ behaviour is a little odd as it doesn’t seem to go into ‘deep sleep’. It only shuts the apple logo off but its still working along silently. One day I put the laptop in the bag and took it to office, only to realize that it has somehow ‘awakened’ in the bag the my laptop bag was as warm as a heating pad. Now, I manually set it off to sleep before I close the lid (a little Windows XP ish, I know). I shall continue my ‘investigation’ and report back on progress. I am sure it’s my setup somehow. Moving on, today we’ll see what it takes to setup .NET on Linux (aka Mono). Before that I realized I didn’t have wireless drivers. So we’ll start with Wireless Driver installation.

Setting up Wireless on OSX (2009 MBP)

1. The wireless driver is not ‘free’ as per GPL licensing so it is not a part of the default installation. To use apt you have to first add a contrib component to /etc/apt/sources.list. This basically apt where to get the non-free contributions from.

sudo nano /etc/apt/sources.list deb http://http.debian.net/debian/ jessie main contrib non-free

2. Update packages list

sudo apt-get update

3. Install Broadcomm Firmware driver. Note your laptop may have different chip, notably by Atheros. To know more visit https://wiki.debian.org/bcm43xx

sudo apt-get install firmware-b43-installer

4. Reboot

sudo shutdown -r now

5. Once rebooted, the wireless devices should be listed in the system tray, just pick the one that’s yours and connect to it and provide password as required.
I’ve had a couple of crashes after installing this driver, I am not sure if I can attribute them to this driver directly. I will keep looking and update back if I find the root cause.

Setting up Mono and MonoDevelop

As a .Net and C# geek, I need to be able to code in C# on my Linux box. So first thing to do is setup Mono and MonoDevelop. Once we have this in place we’ll look at secondary tools and platforms like Atom editor and NodeJs.

1. Goto Mono’s default guide at http://www.mono-project.com/docs/getting-started/install/linux/ and follow the steps. Repeated here for Jessie on Macbook Pro
2. Add GPG Key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

3. Add Repository to list of sources

echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list

4. Update apt

sudo apt-get update

5. Adding mod_mono repository to list of sources

echo "deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

6. Adding libgdiplus support to Debian Jessie

echo "deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main" | sudo tee -a /etc/apt/sources.list.d/mono-xamarin.list

7. Update apt again

sudo apt-get install update

8. Install Mono Development kit (about 155 MB)

sudo apt-get install mono-devel

9. Install Mono-complete (additional 77 MB)

sudo apt-get install mono-complete

10. Install PCL Support (Portable Libraries, additional 28.2 MB)

sudo apt-get install referenceassemblies-pcl

11. Install MonoDevelop

sudo apt-get install monodevelop

12. Install MonoDevelop NUnit plugin

sudo apt-get install monodevelop-nuit

13. Install Git (One would think Git comes installed with every Linux installation. While this is true for a lot of distributions, we installed from a Live CD installer, so it was the leanest installation possible).

sudo apt-get install git

14. Install MonoDevelop Version Control plugin

sudo apt-get install monodevelop-versioncontrol

15. Install MonoDevelop Database plugin.

sudo apt-get install monodevelop-database

At the time of writing this plugin failed to install with the following error, I have ignored it for now, will revisit if I encounter a pressing need for the plugin.

Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
monodevelop-database : Depends: libmono-npgsql4.0-cil (>= 1.0) but it is not going to be installed
Depends: libmono-system-data2.0-cil (>= 3.12.0) but it is not going to be installed
Depends: monodevelop (< but is to be installed
E: Unable to correct problems, you have held broken packages.

At this point you are setup to create simple .NET applications – both console and MVC.

Setting up NodeJS, PHP and the Atom Editor

The Atom editor, as defined by its creators (at Github), is a Hackable code editor that’s fast becoming the goto tool as opposed to heavy IDEs like Visual Studio/MonoDevelop/IDEA/Eclipse etc. It does use Google Analytics for tracking usage and improving itself. If you are not comfortable with Google Analytics, you can disable the module (and I hope it doesn’t it doesn’t send anything more to Google).

The easy way

The easy way to get Atom is to download the pre-built package from https://atom.io/download/deb# and install it using

sudo dpkg -i atom-amd64.deb

The hackable way

The hackable way of course is to download the entire build tool chain and build it locally. There is a nice set of steps documented here https://github.com/atom/atom/blob/master/docs/buildinstructions/linux.md and it worked for me perfectly. It hot links to NodeJS installation instructions that are a bit redundant at the time of writing, so I’ll just collate everything here:
1. Install Toolchain (note I am not re-installing git here because we did that earlier already)

sudo apt-get install build-essential libgnome-keyring-dev fakeroot

2. Install Node

sudo apt-get install nodejs

3. To avoid conflict with another package node is installed as nodejs. If you don’t have the amateur radio package called Node you can setup an alternative. To first check use the following command
sudo which node If this doesn’t return any values, it means you are safe to setup node as the alternate command to nodejs. You can do this as follows

sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10

Now if you do a sudo which node you’ll see it points to /user/bin/node
4. Install NPM (node package manager) next

sudo apt-get install npm

Clone the Repository
5. Change to your standard projects, folder mine is in /home/sumitkm/MyProjects/github

git clone https://github.com/atom/atom

6. Checkout the latest atom release

cd atom
git fetch -p
git checkout $(git describe --tags `git rev-list --tags --max-count=1`)

7. Build Atom into a custom folder. I created a /build folder under /home/sumitkm/MyProjects/builds

script/build --build-dir /home/sumitkm/MyProjects/builds/atom

This will take a while as it downloads and installs all the packages required to build Atom and then does the actual build. If all goes well, you should have a success message at the end of the installation. Note: If you have not restarted the terminal/console after installing node and the installation fails, restart the terminal and you SHOULD NOT require a sudo to run the script. If you get a deduping error clear out the ../github/atom/node_modules folder using rm -rf.
8. Install Atom as

sudo script/grunt install --build-dir /home/sumitkm/MyProjects/builds/atom

You are now all set to use Atom and also with NodeJS should you want to build NodeJS services.

Looking Back…

I did not expect it to be all sunshine and bunny rabbits when I decided to give Linux a try. But it has not been that bad. The VM on my desktop just works marvellously. The on the metal laptop has a few quirks, that I am sure I can sort out. Linux desktop remains the enthusiast’s OS but it has grown well I’ll say. And of course the amount of documentation out there is also pretty phenomenal. This experiment shall continue well into my new laptop whenever I get it…

Tagged , , , , ,

Dual Booting LINUX (Debian Jessie) and OSX (Yosemite)

Back in my college days (aka… once upon a time, very long time ago) Linux installation used to conjure up pictures of geeks sitting amidst a forest of cables, wires and exposed h/w parts, peering into consoles with green text (been there, done that). Well, if you still think the same, you are in for a surprise with any of the contemporary Linux distributions today. They are just as neat, efficient and functional as any of the commercial OS vendors (snicker snicker Winking smile). Today I am going to try and document what I did to get Debian Jessie on my MBP alongside OSX.

Starting off

To start off with I already had a Windows partition along with OSX Yosemite. I had used Bootcamp’s regular instructions at the time so nothing special.

Step 1: Create a Windows partition with Bootcamp.
Step 1a (Optional): Mentioning it because I had Windows 10 installed, so you can install some version of Windows. But if you don’t I am assuming it will be fine.

Step 2: Download the latest CD for Debian, I used Jessie because that’s the current release for AMD64/x86 Architecture.

Step 3: Download Rufus the Bootable USB creation tool. In the past I have used the Windows USB tool but now-a-days ISO images come in multiple formats that the dumb USB tool can’t interpret. So Rufus! (Yes, I used Rufus on a Windows machine, if you are OSX only you can use a suitable tool e.g. https://launchpad.net/ubuntuusbcreator-osx not used it myself so not sure of effectiveness).

Step 4: Plug in a suitable USB stick and ask Rufus to create a Bootable USB for you (MBR/FAT32). Once done shut down the MBP, plug in the USB stick (in case you used a different machine to create it).

Step 6: Press the power button while holding the Option key on the MBP’s keyboard. This should bring up the boot menu that will present a bright orange image of a USB stick as EFI boot. Select it and you should be presented with Debian’s installation menu.

Step 7: Select ‘Install Debian’ to start installation process. I don’t have images of each step, but roughly there is the sequence:
a. Select Type of Install – Graphical or Text Based (Text Based simply means ASCI GUI instead of a Windowed GUI. You don’t have to type in commands on a green terminal at any point. (I chose Text Based)
b. Select Language and Keyboard Layout
c. You can choose to not provide a root password and simple create a user account with strong password. The installation will add this user to the sudoers list automatically. This will disable the root account though.
d. NOTE: Step d and e may be swapped in sequence of events, I don’t remember exactly. At this point it tries to access Wifi and since Broadcomm’s Wifi chipset in my MBP (ymmv) doesn’t have a driver bundled, the installer gives you the option of getting the driver separately and providing it. I simply skipped it because my laptop was plugged into the wired network. Having a live internet connection is really the key to a smooth install. Once the network drivers were installed and network connection established you are nearly ready to fly.
e. Next comes the critical step of disk partitions.

Step 8: Partitioning the drive – Debian gives you options of Automatic Install, Manual Install and Overwrite entire disk with a couple of options.
If you select Automatic partition it will first try to see if you have free un-partitioned space. If you don’t have a Windows installation it will find this unpartitioned Free Space and ask you proceed (select the defaults and proceed).

However, if you have a Windows Partition already, you’ll HAVE to select the Manual Install.
Assuming you only one SSD/HDD you’ll see it as sda (0,0,0) and you should see another reference to the USB drive.
– On sda(0,0,0) you’ll see either one or two HFS+ partitions depending on whether OSX installation created a recovery partition or not.
– The other partition should each be the Windows Partition. Select this and erase it. Once it is done, you will again see it as Free space. Select it and say use this partition. The installer will ask you how to you want to partition it, select the default and you’ll be fine. Once done you are ready to go.

e. The installer will ask you the nearest mirror to get updates from. Select appropriately and off you go.
f. I had around 1400+ updates that were downloaded and installed in about 35 minutes (ymmv depending on your internet speed).
g. You will be given the option to select your XWindow environment, I chose Cinnamon, you can chose between KDE, GNOME and a few more options.

g. Once installation completes you will see the installer setting up GRUB bootloader (I got version 2.02 Beta2-22). Once GRUB finishes, the installer will as you to unplug the USB drive and shutdown the system.

Powering up to Linux

Next time you power up, you will see the GRUB menu. Don’t panic, your precious OSX installation hasn’t vanished. If you want OSX press the Option key when powering up and you can boot into OSX again. There you go, all set to play with the Penguin on your Fruity laptop.

Looking Back…

About 4 months ago I had tried my last attempt at breathing new life into my dated 2009 MBP by installing a brand new 500Gig Crucial SSD in it. While installing OSX Yosemite wasn’t a problem in the first 250Gigs. The experiment with Windows 10 (started with technical previews) in the other 250 went horribly wrong. Long story short, Windows 10 simply was too painful to use on the laptop. I had hopes of things improving after Windows 10 RTM-ed but no luck. Eventually I decided time had come to try something else. Since I was going to Raspberry Pi work on the side, I thought it would be a good idea to try Debian on full blown desktop environments. Lets see how this experiment goes.

Tagged ,
%d bloggers like this: