Linux and Windows 8 Interoperability

Now that Microsoft has released Windows 8, Linux users have lots of questions about how well it works and plays with Linux. Does Windows 8 work with services such as Samba – the collection of software that allows Linux to participate in Windows file sharing? And that’s not the only question. Over the past year, we’ve heard quite a bit about the Unified Extensible Firmware Interface (UEFI) and how it can cause problems with those who want to dual-boot Linux with Windows 8. And what about the ability for Windows 8 users to read and write to Linux filesystems? This article describes how to set up Samba, dual-boot Windows 8 with Linux, and install Linux filesystem software on a Windows 8 system.

Joining Windows 8 to a Samba 3.6.9 Domain

You can get a Windows 8 system to join a Samba current domain, but until the members of the Samba project finish their work, you need to make changes to each Windows 8 system you want to use with Samba.

The source of the problems seems to be that there are several versions of the Common Internet File System (CIFS), which Windows systems use to establish shares and join domains. The specific issue that standard Windows 8 systems seem to have is that they don’t use the DNS header information that Samba expects. Also, the Windows 8 systems I’ve tested default to a very strict interpretation of DNS.

You can fix this problem with the following steps. By the way, I’m assuming you’ve already created a valid Samba domain. If you don’t have a working Samba domain, you might want to go to the Samba website to learn more.

To resolve this DNS issue, you need to edit your Windows 8 system’s registry and set a primary DNS suffix in the Computer Name dialog box. To set a primary DNS suffix here, all you have to do is right-click on Computer and choose Properties , or bring up the Windows 8 Charm bar by selecting Win+I and choosing Advanced System Settings . Once there, go to Computer Name and set the suffix by choosing a name that contains a DNS suffix appropriate to your situation. Make sure the DNS suffix is set to the Fully-Qualified Domain Name of your system. For example, if your DNS name is james.company.com , then take the necessary steps to choose that full name as your computer name.

Next, you need to edit the Windows 8 registry:

  • Log in as Administrator, or with a user that has sufficient permissions to update the Windows registry.
  • Back up your system registry, just in case. Minor changes to the Windows registry have caused serious networking issues in Windows systems. Many is the time a minor change in the registry caused corruption in the registry’s flat-file database or even rendered the system unbootable. My solution for this is to create a backup and store it in a safe, secure place. That way, I can use the Windows 8 Troubleshooting options to restore the registry in case of a problem.
  • Using Notepad or another standard text editor (not Word or OpenOffice), create a text file named sambafix.reg . This file will contain instructions you want to add to the Windows registry. Make sure the file you create has the .reg extension, or else the following steps won’t work. Windows 8, like Windows 7, is configured to execute any file named .reg in such a way that it will update the registry, as long as you have sufficient permissions.
  • With the sambafix.reg file still open, enter the following lines:
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManWorkstation\Parameters]
DWORD DomainCompatibilityMode 1
DWORD DNSNameResolutionRequired 0

The preceding code tells the registry to add two DWORD values to the sub-area of HKEY_LOCAL_MACHINE .

  • To finish the process of updating the Windows 8 registry, double-click the sambafix.reg file you have created. Windows 8 will do the rest of the work in editing the registry.
  • Reboot your system (otherwise, Windows 8 will give you error messages when you try to log in to the Samba domain).
  • Now reboot and connect to a Samba domain. You will be asked for the password for the Samba domain account. Supply it, and you will be connected.

Microsoft actually went to quite a bit of trouble to make sure Windows 7 worked well with Samba. That doesn’t necessarily mean that Microsoft will continue to do the same with Windows 8, of course, but it stands to reason that, in time, Microsoft and the Samba developers will find a solution to this problem and the workarounds described in this section won’t be necessary.

Dual-Booting with Linux

Virtualization is a popular option for accessing two different systems from the same hardware. You’ll learn more about VMware Workstation virtualization in the next article, but what about those old-school people who still want to dual-boot Linux rather than simply virtualize? Dual-booting is possible if you’re buying new hardware, and it’s very easy if you’re not. The issues with dual-booting on new hardware are related to a universal change that’s taking place in how system BIOS works.

Way back in the 1990s, Intel realized that the time-honored BIOS and firmware setup wasn’t particularly stable or secure. Over the years, we’ve seen the havoc that viruses and trojans have wreaked on unsecured BIOS-run systems.

Intel proposed to replace BIOS with a more sophisticated system called the Unified Extensible Firmware Interface (UEFI), which has finally reached adoption. UEFI is now managed by the Unified EFI Forum, rather than Intel. With Windows 8, original equipment manufacturers such as Dell, Asus, Acer, and others have combined with Microsoft and the Unified EFI Forum to make this new system a reality.

UEFI offers the following benefits:

  • Faster input and output for attached devices
  • Ability to boot disks larger than 2.1TB
  • A unified protocol for developing and loading device drivers
  • Better graphics support
  • Secure Boot

The Secure Boot feature, officially known as the UEFI 2.2 specification, requires the use of digital signatures to allow – or prevent – the loading of device drivers and operating systems. This precaution helps fight malware, such as trojans and viruses. If an operating system or process does not have the proper digital signature, it can be excluded from the boot process.

Microsoft has made sure that it supports Secure Boot, and many manufacturers have combined to enable this feature. Supporters of UEFI like the additional capabilities and security it provides. However, others are skeptical of UEFI because restricting access to the BIOS tends to restrict user choice and block innovation.

If you purchase a new UEFI-enabled system, any new operating system you install will need to supply a digital signature, or Secure Boot (if enabled) will not allow it to load.

There’s no single answer about installing Linux on a Windows 8 system, because you have to consider two issues: the hardware and firmware (e.g., your new Asus system with UEFI) and the operating system (Windows 8). So, here are the two major scenarios to consider.

If you have updated an old PC to Windows 8 and it has an incomplete version of UEFI installed or uses standard BIOS, you can dual-boot any version of Linux to your heart’s content. There are no limitations or issues, other than the typical “Updating to Windows 8 erased my GRUB implementation” issues that I’ll discuss shortly.

On the other hand, if you want to install Linux on a UEFI-enabled Windows 8 computer, you have the following choices:

  • Use a version of Linux that uses a signed key that Secure Boot recognizes. Red Hat, Fedora, and Linux Mint all have digital signatures that UEFI will recognize. Many individuals in the Linux community feel that it isn’t proper for open source systems to buckle to pressure from Microsoft and the original equipment manufacturers in this way. For many others, though, getting a Linux system up and running in a dual-boot environment is more important.
  • If you don’t want to have the operating system choice pushed on you, you might be able to deactivate the Secure Boot option in your firmware. Although you can’t disable UEFI altogether (because it’s a BIOS replacement), you can, on some systems, tell UEFI to disable Secure Boot features. Doing so will reduce your boot security, but it will allow other operating systems to boot.
  • Obtain a key from the Linux distribution you want to use and add the key yourself using the UEFI-supplied screens at boot time.

The Easy Way to Dual-Boot: Linux After Windows 8

Although it’s best to simply virtualize a Linux system from my Windows systems, it is nevertheless possible to dual-boot a Linux system on your Windows 8 system, as long as the system’s hardware and UEFI implementation doesn’t get in the way. The steps are:

  1. Install or upgrade to Windows 8. If you install Linux first and then Windows 8, Windows 8 will simply overwrite any existing non-Microsoft operating system without asking.
  2. Resize, or “shrink,” your hard disk partition from within Windows.
  3. Install Linux.

“Shrinking” a Windows 8 volume simply means you create empty space on a hard disk by resizing the volume(s) that contain Windows 8. Like any sophisticated operating system, Windows offers more than one way to create an empty partition. I prefer the Win+R option, which brings up the Run menu.

Once the Run menu appears, type the following in the Open text box:

diskmgmt.msc

After pressing Enter, you’ll see the Disk Management MMC console, as shown in Figure 1.

Figure 1: The Windows 8 Disk Management Console.

From the contextual menu you get by right-clicking on the partition, select Shrink Volume , and shrink it by the amount of space you want to give the new system. Generally, I give my Ubuntu system about 100GB on my 500GB system.

It will take some time to shrink your hard disk. Once you’re finished, you can then select the version of Linux you want to use and install it in the free space.

Figure 2: Options in the Windows 8 Troubleshoot window.
Figure 3: Open the Advanced options window to access the command prompt.
Figure 4: Using the fixmbr option in Windows 8 Recovery Mode.

Re-Installing with GRUB from a Live CD

When you update a Microsoft operating system, it will eliminate the Linux GRUB bootloader. As a result, you will boot right into Windows 8, rather than have a choice. If you have Linux installed on your system already, and you are adding Windows 8 later, you will need to restore GRUB. Take the following steps using the Live CD from your Linux distribution:

  1. Find the name of the boot drive. In many cases, it will be /dev/sda3 . But you need to use the fdisk -l command to determine exactly which device to specify.
  2. Make sure your system’s BIOS or UEFI firmware is set to boot to the first hard disk sector.
  3. Obtain your Linux Live CD and insert it in your CD or DVD drive.
  4. Boot into Linux Safe Mode or even into a full Linux environment.
  5. If in Linux Safe Mode, issue the grub-install or grub2-install command in /dev/sdX ,where X is your boot disk.

Reboot your system. GRUB will now give you the choice to boot into Linux or to boot into Windows 8.

Reading ext2 Filesystems from Windows 8

If you want to have read-write access to Linux filesystems from your Windows system, the best answer is a tool called Ext2Fsd. You can download the Ext2Fsd installation binary from the project website or from the SourceForge page.

In addition to read-write access to files, Ext2Fsd supports:

  • Automatic assignment of mountpoints, which makes it easier to access your Linux files.
  • The ability to write large files of more than 4GB.
  • Sharing of files via CIFS, which means you can network mapped Linux drives in Windows.
  • Journaling in the ext3 and ext4 filesystems.

The Ext2Fsd project provides a handy GUI interface, the Volume Manager (Figure 5).

Figure 5: Managing file resources with the Ext2Fsd Volume Manager (part of Ext2Fsd).

Once you have obtained the installation binary, simply double-click it to begin installation.

Make sure you have sufficient permissions to install the file; although you won’t need administrative permissions, severely limited accounts, such as those you might have at your workplace, might not allow installation of services such as Ext2Fsd.

The installation binary has a simple Wizard-based interface. The most significant part of the installation occurs when you are given several choices. These choices include telling Ext2Fsd to:

  • Start the Ext2Fsd service automatically when your Windows system boots.
  • Enable write support for ext2 and ext2-compatible filesystems.
  • Allow write support for files to the ext3 journaling filesystem.

Once you’ve followed the wizard-based interface and rebooted, you can boot back into Windows, then access your Linux ext2 and/or ext3 and ext4 filesystems. I have successfully installed Ext2Fsd on Windows 8 and other Microsoft operating systems.

Manually Mounting a Drive in Ext2Fsd

Ext2Mgr provides three methods of mounting a Linux volume:

  • You can use a Windows Application Programming Interface (API) called DefineDosDevice , If you use this method, any drive letter you assign will be lost each time you reboot. Using DefineDosDevice is quick and convenient.
  • You can modify the Windows registry manually to store the driver letter as a DOS or Windows device. To do so, use a tool such as the Microsoft Registry Editor (regedit.exe ). To modify the following key manually, enter:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices] "X:"="2.\\Device\\HarddiskVolume1"
  • You can also use Windows Mount Manager and the manager (called Ext2Mgr). This method provides automatic mounting when Ext2Mgr detects that a new disk is plugged in and removal of drive letters after the disk is removed. If you use removable disks a lot, this is the best choice.

I’ve found that using Mount Manager is the best method for my environment.

Moving around drives is as simple as launching the Ext2Fsd Volume Manager. After you have mounted a drive, you can then navigate through Ext2Fsd.

I’m a big fan of hotkeys, and so are the Ext2Fsd folks. Table 1 shows a quick run-down of the most handy Ext2Fsd hotkeys.

Accessing Files

Once you’ve mounted a Linux volume on your Windows system, you can access it from Windows Explorer as you would any other volume. It will be listed under a drive letter and the root directory icon (\ ). If, for example, you need to access your home drive from the drive J:\ , you would find it as:

J:\home\james\directory

You can then read and write to directories, create and delete directories, and otherwise treat the filesystem as if it were native to Windows.

Conclusion

It appears that Windows 8 works and plays well with the Linux operating system, within limits. You just need to understand what those limits are. When it comes to using Samba, right now you need to configure your Windows 8 registry; however, it’s clear that the Samba team will eventually create a more permanent solution that avoids the need for manual configuration.

When it comes to dual-booting, a brand new system might limit your choice of Linux distributions. When it comes to reading Linux filesystems from within Windows 8, you have several options, but I’ve found that Ext2Fsd remains the best alternative.

I’m encouraged about the ability of Windows 8 and Linux to work and play well together. Although many in the open source community have some serious philosophical issues with UEFI, I think there are good, practical options for Linux users in the UEFI era.

Info

[1] Linux Foundation UEFI Secure Boot System for Open Source

Related content

comments powered by Disqus