A very good friend asked me to install Linux on his new laptop. It is a Samsung NP550P5C-A01UB. He has used Linux in the past, but he has a requirement to run a Windows-only program. Not sure how he would want to meet that requirement exactly, I decided to give options. I shrunk the original Windows 8 to make it dual boot. Then, I installed Windows in Virtual Box so that Linux and Windows could run at the same time. Finally, I installed Office with Wine to allow for editing Office docs natively.
My first task was to back up the PC before I did anything. I wanted a snapshot so that I could get it back to the way the laptop was given to me. Clonezilla was the tool of choice. It boots from a CD or USB drive and it can snapshot a harddrive.
Bad EIP Value
When it booted with my first image of clonezilla (clonezilla-live-20121217-quantal.iso), it wouldn’t work. I tried adding the following options in the boot menu:
pci=noacpi nobiospnp noapic nolapic
Unfortunately, that didn’t solve my problem. I ended out just downloading the latest version from SourceForge/the Clonezilla website.
Creating the Clonezilla USB Drive
The “Make Startup Disk” program that I have been using has been crashing for me. So, I set out to find a better way. UNetbootin stepped in to save the day! It was an easy install from the Software Center, and it worked with no problem.
The “Distribution” option looked cool. I didn’t read up on it, but it looks like it would download the version for you. The only problem was that all of the versions were out of date. So, I downloaded the latest version myself and I used the “Diskimage” option.
Clonezilla gave me this error message:
This disk contains mismatched GPT and MBR partition: /dev/sda
It will confuse Clonezilla and might make the saved image useless or fail to clone the disk.
You can use gdisk or sgdisk to fix this issue. E.g. if you are sure only MBR partition table is the one you want, you can run this command to destroy the GPT partition table while keep the MBR partition table:
sudo sgdisk -z /dev/sdx
First things first, I backed up the master boot record —
sudo dd if=/dev/sda of=GPT bs=512 count=34
If I needed to restore, I should be able to use this:
sudo dd if=GPT of=/dev/sda bs=512 count=34
Here’s the output of: sudo fdisk -l /dev/sda
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 718847 358400 7 HPFS/NTFS/exFAT
/dev/sda2 718848 1465147391 732214272 7 HPFS/NTFS/exFAT
I checked, and this drive wasn’t over 2TB, so I just got rid of the GTP. I ran this command:
sudo sgdisk -z /dev/sda
After rebooting clonezilla, the backup worked fine.
Installing Linux Mint
I downloaded the latest version of Linux Mint. I chose the Cinnamon 64-bit version from the download page. And, I used UNetbootin to put it on the USB drive.
When it asked for installing beside Windows, I chose “Install Linux Mint alongside Windows 8”:
The interface to choose the size was very nice. I could just drag the divider, and I chose to split the space like this:
Finally, the install finished and reported no problems:
Fixing the Bootloader
After the install, it would only boot into Windows. It wouldn’t load any bootloader.
I tried to load/install grub manually. Here the commands that I used, but I won’t bother explaining them because they didn’t work:
sudo fdisk -l /dev/sda
sudo mount /dev/sda5 /mnt
sudo mount -o bind /dev /mnt/dev
sudo mount -t proc none /mnt/proc
sudo cp /etc/resolve.conf /mnt/etc
sudo chroot /mnt /bin/bash
sudo mount -t sysfs none /sys
sudo mount -t devpts none /dev/pts
sudo apt-get update
sudo apt-get install grub-efi
sudo grub-install /dev/sda
sudo grub-install /dev/sda1
sudo umount /mnt/dev/pts
sudo umount /mnt/dev
sudo umount /mnt/proc
sudo umount /mnt/sys
sudo umount /mnt
Unfortunately, no luck.
Switching to Ubuntu
Finally, I decided to give up on Linux Mint. I have more experience with Ubuntu, so I thought I would see if it makes a difference. I found documentation that looked like they had the new bootloader issues taken care of.
I removed the partitions that Linux Mint created using gparted (had to launch with sudo gparted). It had mounted the the Swap partition, so I had to use the swapoff option before it would let me delete:
It cleaned up like this:
Next, I went through the install, and it just asked if I wanted to install along side Windows
So, here’s the result after the install:
The install went fine. The only problem was that it still wouldn’t boot to Linux. It was like it didn’t install any bootloader at all!
I finally found a program called “Boot Repair”. It was supposed to fix issues like what I was running into.
I used the following two commands to install and launch boot repair:
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
sudo apt-get install -y boot-repair && (sudo boot-repair &)
Then I clicked on the “Recommended Repair” button. It had me run a couple of things in the terminal.
I did run this:
[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"
It said that I was installed in EFI mode.
After the reboot, I was good to go.
Getting Up to Date
I ran this to download the latest updates:
sudo apt-get update
sudo apt-get upgrade
I was able to install Virtual Box very easily from the Software Center. Then, I downloaded the latest version of the Clonezilla image. I created a machine with 3G of RAM and a dynamically allocated 500G drive. I set the Clonezilla.iso as the CD drive.
When I booted the image, it gave me an error about the kernel not being available.
To fix the problem, I tried:
sudo apt-get remove virtualbox-dkms
sudo apt-get install virtualbox-dkms
That’s when I got the message:
Module build for the currently running kernel was skipped since the kernel source for this kernel does not seem to be installed.
I made sure that the linux-headers-generic package was installed, and it was. Then, after playing with it for a while, I noticed there was a kernel update. So, I let Software Updater do it’s job. After rebooting, the machine worked.
The next challenge was getting Clonezilla to see the USB drive in the virtual machine. I found that I needed to check the “Enable USB 2.0 (EHCI) Controller” on the USB tab of the VM’s settings. When I did that, it said that I needed the “Oracle VM VirtualBox Extension Pack”. That requires a different installation of Virtual Box, and I dropped that idea.
So, I created a new virtual drive. Then, after booting CloneZilla and going to the command line, I created a new partition with fdisk. Then, I formatted it with:
sudo mkfs.ext3 /dev/sdb1
Next, I had to mount that drive on the host so that I could copy my clonezilla backup to it. I installed:
sudo apt-get install virtualbox-fuse
To mount the drive on the host, I ran:
sudo vdfuse -a -f "<path to vdi file>" /mnt
Then, I needed to mount the partition:
sudo mount -o loop /mnt/Partition1 /mnt2
After that, I had access to the clonezilla backup. I was able to unmount the partition and boot the virtual machine. Clonezilla restored the backup onto the machine, and I was good to go.
Finally, I had to fix the NAT … I followed my old instructions and ran these commands:
vboxmanage modifyvm "Windows 8" --natdnshostresolver1 on
vboxmanage modifyvm "Windows 8" --nic1 nat
Installing Microsoft Office on Wine
I tried to install via Play on Linux, but the install wouldn’t work. At first, I thought the problem was because I had a different version of Office than what was expected. Looking back, I think it was because I had the wrong CD in. It was a 3 disk set, but I didn’t see that at first.
So, I installed by following this post and installed it manually:
sudo apt-get install mesa-utils mesa-utils-extra libgl1-mesa-glx:i386 libgl1-mesa-dev ia32-libs
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/mesa/libGL.so
sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so /usr/lib/i386-linux-gnu/libGL.so
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine
Then, I ran winetricks and installed:
- corefonts (under install a font)
Then, in winecfg, I set:
- msxml6 to native
- gdiplus to native
Next, I used wine to run the setup program on the CD.
After installing, I ran winecfg one more time and set riched20 to native.
Thankfully, my persistence paid off. I was able to get the machine up and running. I wasn’t super happy with the performance of the machine. It seemed to run slow at times, which is frustrating for a brand new machine. I ended up coming back and installing Windows Vista for the virtual machine. The Windows 8 just didn’t work well in Virtual Box.
Also, I think it is worth noting that I could have probably used that “Boot Repair” program with Linux Mint. Both are debian based, and I think it would have worked had I discovered it before trying Ubuntu.
I hope these notes help someone else. They are a bit abbreviated at times, but at least I have some notes as to what I did.