cybercore
New Member
- Joined
- Jul 7, 2009
- Messages
- 15,641
- Thread Author
- #1
Dual-Boot Windows 7 and Ubuntu in Perfect Harmony
Link RemovedWindows 7
and Ubuntu, despite their opposing missions, can get along like best pals on a single computer. Here's how to set up a dual boot system that lets you enjoy the best of both worlds in perfect harmony.
By default, Windows 7 takes over your boot-up process and wants to be your only OS, and Linux treats Windows like a weekend hobby you keep in a shed somewhere on your hard drive. But I've been dual-booting Ubuntu and some version of Windows 7 for nearly a year, and I've learned a lot about inconveniences, annoyances, and file-sharing necessities, and now I'll walk you through how to set up your systems to achieve a peaceful union of your dual-boot OSes. (Both with Windows 7 already installed, and with a clean system ready for a new dual-OS existence.)
Follow through this guide, and I'll explain how to rebuild a system from the ground up with Windows 7 and Ubuntu, with either a backed-up and cleaned-out hard drive (recommended) or Windows 7 already installed. When we're done, you can work and play in either operating system, quickly and conveniently access your documents, music, pictures, and other files without worry or inconvenience, and boot into either system without having to worry about whether Windows is going to get mad at you. Plus, when Ubuntu 10.04 or Windows 8 come along, you'll find it much easier to install either one without having to start over entirely from scratch.
What you'll need
Setting up your hard drive
If you've got nothing installed on your system, or you've got your data backed up and you're ready to start from scratch, you're in a great position--skip down to the "Partition your system" section. If you've got Windows already installed, you can still make a spot for Ubuntu, though.
(Only) If Windows is already installed: You're going to "shrink" the partition that Windows 7 installed itself on. Before we do that, clean out any really unnecessary applications and data from your system (we like Revo Uninstaller for doing this). Also, open up "Computer" and take note of how much space remains on your main hard drive, presumably labeled "C:". Head to the Start menu, type "disk management" into the search box, and hit Enter.
Windows 7 probably put two partitions on your hard drive: one, about 100 MB in size, holding system restoration data. We don't want to touch it. Right-click on the bigger partition to the right, and choose Shrink Partition.
Link Removed due to 404 Error
After a little bit of hard drive activity and a "Please wait" window, you'll get back the size you can shrink your Windows partition by.
Link Removed
If the space Windows offers doesn't jibe with what your Computer view told you was "remaining," you might need to hit Cancel, then head back and defragment your hard drive, and take some of the steps Link Removed. Run the Disk Management tool again and try a Shrink Volume operation again, and free up as much space as you can.
Partition your system: You're aiming to set up a system with three partitions, or sections, to its hard drive: One lean partition for the Windows operating system and applications running from it, another just-big-enough partition for Ubuntu and its own applications, and then a much larger data partition that houses all the data you'll want access to from either one. Documents, music, pictures, application profiles—it all goes in another section I'll call "Storage" for this tutorial.
How do you get there? We're going to use GParted, the Linux-based uber-tool for all things hard drive. You could grab the Live CD if you felt like it, but since you've already downloaded an Ubuntu installer, you can simply boot a "live," no-risk session of Ubuntu from your CD or USB stick and run GParted from there. Once you're inside Ubuntu, head to the System menu in the upper left when you get to a desktop, then choose the Administration menu and GParted under it.
Link Removed
You'll see your system's hard drive and its partitions laid out. You're going to create partitions for Linux and your storage space, but not Windows—we'll let the Windows installation carve out its own recovery partition and operating space. On my own system, I give Windows 15 GB of unallocated space, and Ubuntu another 15 GB of space right after it, with whatever's left kept as storage space. Then again, I've only got a 100 GB hard drive and don't run huge games or applications, so you can probably give your two operating systems a bit more space to grow.
Click on the unallocated space and hit the "New" button at the far left. In the "Free space preceding" section, click and hold the up button, or enter a number of megabytes, to leave space for Windows at the front. When you've got the "space preceding" set, set the actual size of the Ubuntu partition in the "New Size" section, and leave "Free space following" alone. Choose "unformatted" under file system—we'll let Ubuntu do the format itself and hit "Add." Back at the main GParted window, click on the space to the right of your two OS spaces, hit "New" again, and set the file system as "ntfs." Give it a label like "Storage," hit "Add," and at the main GParted window, hit the checkmark button to apply your changes. Once it's done, exit out of GParted and shut down the system from the pull-down menu in the upper-right corner.
If Windows is already installed: If you've shrunk down its partition for free space and booted into a live Ubuntu or GParted, click on the "Unallocated" piece next to the two "ntfs" partitions that represent your Windows 7 installation and system recovery tools. Create a 15(-ish) GB unformatted partition, and give it a label like Ubuntu. If you've got a good deal of space left, format it as "ntfs" and label it something like "Storage." If you can just barely fit the Ubuntu partition, you can just keep your media files in the Windows partition—until you can remedy this with a full wipe-and-install down the line.
Experienced Linux geeks might be wondering where the swap space is going—but don't worry, we'll create one, just not in its own partition.
Installing and configuring Windows
Grab your Windows 7 installation disc—either a full copy or Link Removed due to 404 Error, and insert it into your DVD drive. If your system isn't set up to boot from CD or DVD drive, look for the button to press at start-up for "Boot options" or something similar, or hit up your system maker's help guides to learn how to change your boot order in the BIOS settings.
Follow through the Windows 7 installation, being sure to choose "Custom" for the installation method and to point it at that unallocated space we created at the beginning of your hard disk, not the NTFS-formatted media/storage space we made earlier:
Link Removed
Work your way through the Windows 7 installation, all the way until you reach the Windows desktop. Feel free to set up whatever programs or apps you want, but what we really want to do is set up your Storage partition to house your pictures, music, video, and other files, and make your Libraries point to them.
Hit the Start menu, click Computer, and double-click on the hard drive named "Storage" (assuming you named it that earlier). In there, right-click and create new folders (or hit Ctrl+Shift+N) for the files you'll be using with both systems. I usually create folders labeled Documents, Music, Pictures, and Videos—I could also see folders for saved games and data files from big software packages. Copy your media files into these folders now, if you'd like, but we've got a bit more tweaking to pull off.
In the left-hand sidebar, you'll see your "Libraries" for documents, music, pictures, and video. At the moment, they point to your Public shared folders and the My Pictures-type folders on your main Windows drive. Click once on any of the Libraries, and at the top of the main panel, you'll see text stating that this library "Includes: 2 locations ...". Click the blue text on "2 locations," then click on each of the folders below and hit "Remove" on the right-hand side. Now hit "Add" and select the corresponding folder on your Storage drive. Do the same for all your music, pictures, videos, and other media folders.
Link Removed due to 404 Error
Want to add another library for quick access? Right-click somewhere on the desktop, choose New->Library, and follow the steps.
That's about it for Windows. Now get your Ubuntu CD or USB stick ready and insert it in your system. Ignore whatever auto-play prompts appear, and restart your system.
Installing and configuring Ubuntu
Restart your computer, this time booting from your Ubuntu Live CD or USB boot drive. When your system boots up, choose your language, select "Try Ubuntu without any changes to your computer," and you'll boot into a "live" desktop, run entirely off the CD or USB stick. Once you're booted up, try connecting to the internet from the network icon in the upper-right—it helps during the installation process, ensures your network is working, and gives you something to do (Firefox) while the system installs.
Click the "Install" link on the desktop, and fill out the necessary language/location/keyboard info (most U.S. users can skip through the first 3 screens). When you hit the "Prepare disk space" section, select the "Specify partitions manually" option, then hit Forward. Select the free space that's after your first two Windows partitions with ntfs formats, then hit the "Add" button at bottom. Your partition should already be sized correctly, and the only thing to change is set "/" as a mount point. Here's what your screen should look like:
Link Removed due to 404 Error
Click OK, then finish through with the Ubuntu installation. If it catches your Windows 7 installation, it might ask if you want to import settings from inside it—you can, if you'd like, but I usually skip this. Wait for the installation to finish, remove the CD or thumb drive, and reboot your system.
When you start up again, you'll see a list of OS options. The only ones you need concern yourself with are Windows 7 and the top-most Ubuntu line. You can prettify and fix up this screen, Link Removed - Invalid URL, and Link Removed due to 404 Error later on. For now, let's head into Ubuntu.
We're going to make the same kind of folder access change we did in Windows. Click up on the "Places" menu, choose "Home Folder," and check out the left-hand sidebar. It's full of links to Documents, Pictures, and the like, but they all point to locations inside your home folder, on the Linux drive that Windows can't read. Click once on any of those folders, then right-click and hit Remove.
Link Removed
You should see your "Storage" partition in the left-hand sidebar, but without that name—more like "100GB filesystem." Double-click it, type in the administrator password you gave when installing, and you'll see your Documents, Music, etc. Click and drag those folders into the space where the other folders were, and now you'll have access to them from the "Places" menu, as well as any file explorer window you have open.
Ubuntu won't "mount," or make available, your Windows 7 and Storage drives on boot-up, however, and we at least want constant access to the Storage drive. To fix that, head to Software Sources in the System->Administration menu. From there go to Applications, then the Ubuntu Software Center at the bottom. Under the "Ubuntu Software" and "Updates" sections, add a check to the un-checked sources, like Restricted, Multiverse, Proposed, and Backports. Hit "Close," and agree to Reload your software sources.
Link Removed
Finally! Head to the Applications menu and pick the Ubuntu Software Center. In there, search for "ntfs-config," and double-click on the NTFS Configuration Tool that's the first result. Install it, then close the Software Center. If you've got the "Storage" or Windows 7 partitions mounted, head to any location in Places and then click the eject icon next to those drives in the left-hand sidebar. Now head to the System->Administration menu and pick the NTFS Configuration Tool.
You'll see a few partitions listed, likely as /dev/sda1, /dev/sda2, and the like. If you only want your storage drive, it should be listed as /dev/sda3 or something similar--just not the first or second options. Check the box for "Add," click in the "Mount point" column to give it a name (Storage, perhaps?), and hit "Apply." Check both boxes on the next window to allow read/write access, and hit OK, and you're done. Now the drive with all your stuff is accessible to Windows and Linux at all times.
Adding swap to Ubuntu
"Swap" memory is a section of the hard drive that your system's memory spills over into when it gets full and busy. Until recently, I'd been creating a whole separate partition for it. Recently, though, I've found that swap isn't always necessary on systems with a large amount of memory, and that swap can simply be a file tucked away on your hard drive somewhere.
Follow the Ubuntu help wiki's instructions for adding more swap, but consider changing the location they suggest putting the swap file—/mnt/swap/ for the place your Storage is held—/media/Storage, in my case.
Share Firefox profiles and more
That's about it for this guide to setting up a harmonious Windows and Ubuntu existence, but I recommend you also check out our previous guide to using a single data store when dual-booting. It explains the nitty-gritty of sharing Firefox, Thunderbird, and Pidgin profiles between Linux and Windows for a consistent experience, as well as a few other dual-boot tricks.
You might also want to consider creating virtual machines with VirtualBox for those moments when you're in one OS and need to get at the other. Ubuntu is free to create as many instances as you want, of course, and Windows 7 (Professional and Ultimate) are very friendly with non-activated copies—not that either can't be otherwise activated in cases where it's just a double-use issue.
Link RemovedWindows 7
and Ubuntu, despite their opposing missions, can get along like best pals on a single computer. Here's how to set up a dual boot system that lets you enjoy the best of both worlds in perfect harmony.
By default, Windows 7 takes over your boot-up process and wants to be your only OS, and Linux treats Windows like a weekend hobby you keep in a shed somewhere on your hard drive. But I've been dual-booting Ubuntu and some version of Windows 7 for nearly a year, and I've learned a lot about inconveniences, annoyances, and file-sharing necessities, and now I'll walk you through how to set up your systems to achieve a peaceful union of your dual-boot OSes. (Both with Windows 7 already installed, and with a clean system ready for a new dual-OS existence.)
Follow through this guide, and I'll explain how to rebuild a system from the ground up with Windows 7 and Ubuntu, with either a backed-up and cleaned-out hard drive (recommended) or Windows 7 already installed. When we're done, you can work and play in either operating system, quickly and conveniently access your documents, music, pictures, and other files without worry or inconvenience, and boot into either system without having to worry about whether Windows is going to get mad at you. Plus, when Ubuntu 10.04 or Windows 8 come along, you'll find it much easier to install either one without having to start over entirely from scratch.
What you'll need
- Windows 7 installation disc: For clean installations, either a full installation copy or an upgrade disc is needed. If you own an upgrade disc but want to start from scratch, there's a Link Removed due to 404 Error, though that's a rather gray-area route. Then again, there's probably not a person on this earth that doesn't have a licensed copy of XP or Vista somewhere in their past.
- Ubuntu 9.10 installation image: You can Link Removed, or hit "Alternative download options" to reveal a (usually very fast) BitTorrent link. You'll want to get the ubuntu-9.10-desktop-i386.iso download for 32-bit systems, or ubuntu-9.10-desktop-amd64.iso.torrent for 64-bit on AMD or Intel systems (despite the name).
- Blank CD or empty USB drive: You'll need one of these for burning the Ubuntu ISO, or loading it for USB boot. If you're going the thumb drive route, grab UNetBootin for Windows or Linux, plug in your USB drive, and load it with the downloaded ISO image.
- All your data backed up: Even if you're pulling this off with Windows 7 already installed and your media and documents present, you'll want to have a fallback in case things go awry. Which they shouldn't, but, naturally, you never know.
- Free time: I'd reckon it takes about 2 hours to pull off two OS installs on a clean system; more if you've got a lot of data to move around.
Setting up your hard drive
If you've got nothing installed on your system, or you've got your data backed up and you're ready to start from scratch, you're in a great position--skip down to the "Partition your system" section. If you've got Windows already installed, you can still make a spot for Ubuntu, though.
(Only) If Windows is already installed: You're going to "shrink" the partition that Windows 7 installed itself on. Before we do that, clean out any really unnecessary applications and data from your system (we like Revo Uninstaller for doing this). Also, open up "Computer" and take note of how much space remains on your main hard drive, presumably labeled "C:". Head to the Start menu, type "disk management" into the search box, and hit Enter.
Windows 7 probably put two partitions on your hard drive: one, about 100 MB in size, holding system restoration data. We don't want to touch it. Right-click on the bigger partition to the right, and choose Shrink Partition.
Link Removed due to 404 Error
After a little bit of hard drive activity and a "Please wait" window, you'll get back the size you can shrink your Windows partition by.
Link Removed
If the space Windows offers doesn't jibe with what your Computer view told you was "remaining," you might need to hit Cancel, then head back and defragment your hard drive, and take some of the steps Link Removed. Run the Disk Management tool again and try a Shrink Volume operation again, and free up as much space as you can.
Partition your system: You're aiming to set up a system with three partitions, or sections, to its hard drive: One lean partition for the Windows operating system and applications running from it, another just-big-enough partition for Ubuntu and its own applications, and then a much larger data partition that houses all the data you'll want access to from either one. Documents, music, pictures, application profiles—it all goes in another section I'll call "Storage" for this tutorial.
How do you get there? We're going to use GParted, the Linux-based uber-tool for all things hard drive. You could grab the Live CD if you felt like it, but since you've already downloaded an Ubuntu installer, you can simply boot a "live," no-risk session of Ubuntu from your CD or USB stick and run GParted from there. Once you're inside Ubuntu, head to the System menu in the upper left when you get to a desktop, then choose the Administration menu and GParted under it.
Link Removed
You'll see your system's hard drive and its partitions laid out. You're going to create partitions for Linux and your storage space, but not Windows—we'll let the Windows installation carve out its own recovery partition and operating space. On my own system, I give Windows 15 GB of unallocated space, and Ubuntu another 15 GB of space right after it, with whatever's left kept as storage space. Then again, I've only got a 100 GB hard drive and don't run huge games or applications, so you can probably give your two operating systems a bit more space to grow.
Click on the unallocated space and hit the "New" button at the far left. In the "Free space preceding" section, click and hold the up button, or enter a number of megabytes, to leave space for Windows at the front. When you've got the "space preceding" set, set the actual size of the Ubuntu partition in the "New Size" section, and leave "Free space following" alone. Choose "unformatted" under file system—we'll let Ubuntu do the format itself and hit "Add." Back at the main GParted window, click on the space to the right of your two OS spaces, hit "New" again, and set the file system as "ntfs." Give it a label like "Storage," hit "Add," and at the main GParted window, hit the checkmark button to apply your changes. Once it's done, exit out of GParted and shut down the system from the pull-down menu in the upper-right corner.
If Windows is already installed: If you've shrunk down its partition for free space and booted into a live Ubuntu or GParted, click on the "Unallocated" piece next to the two "ntfs" partitions that represent your Windows 7 installation and system recovery tools. Create a 15(-ish) GB unformatted partition, and give it a label like Ubuntu. If you've got a good deal of space left, format it as "ntfs" and label it something like "Storage." If you can just barely fit the Ubuntu partition, you can just keep your media files in the Windows partition—until you can remedy this with a full wipe-and-install down the line.
Experienced Linux geeks might be wondering where the swap space is going—but don't worry, we'll create one, just not in its own partition.
Installing and configuring Windows
Grab your Windows 7 installation disc—either a full copy or Link Removed due to 404 Error, and insert it into your DVD drive. If your system isn't set up to boot from CD or DVD drive, look for the button to press at start-up for "Boot options" or something similar, or hit up your system maker's help guides to learn how to change your boot order in the BIOS settings.
Follow through the Windows 7 installation, being sure to choose "Custom" for the installation method and to point it at that unallocated space we created at the beginning of your hard disk, not the NTFS-formatted media/storage space we made earlier:
Link Removed
Work your way through the Windows 7 installation, all the way until you reach the Windows desktop. Feel free to set up whatever programs or apps you want, but what we really want to do is set up your Storage partition to house your pictures, music, video, and other files, and make your Libraries point to them.
Hit the Start menu, click Computer, and double-click on the hard drive named "Storage" (assuming you named it that earlier). In there, right-click and create new folders (or hit Ctrl+Shift+N) for the files you'll be using with both systems. I usually create folders labeled Documents, Music, Pictures, and Videos—I could also see folders for saved games and data files from big software packages. Copy your media files into these folders now, if you'd like, but we've got a bit more tweaking to pull off.
In the left-hand sidebar, you'll see your "Libraries" for documents, music, pictures, and video. At the moment, they point to your Public shared folders and the My Pictures-type folders on your main Windows drive. Click once on any of the Libraries, and at the top of the main panel, you'll see text stating that this library "Includes: 2 locations ...". Click the blue text on "2 locations," then click on each of the folders below and hit "Remove" on the right-hand side. Now hit "Add" and select the corresponding folder on your Storage drive. Do the same for all your music, pictures, videos, and other media folders.
Link Removed due to 404 Error
Want to add another library for quick access? Right-click somewhere on the desktop, choose New->Library, and follow the steps.
That's about it for Windows. Now get your Ubuntu CD or USB stick ready and insert it in your system. Ignore whatever auto-play prompts appear, and restart your system.
Installing and configuring Ubuntu
Restart your computer, this time booting from your Ubuntu Live CD or USB boot drive. When your system boots up, choose your language, select "Try Ubuntu without any changes to your computer," and you'll boot into a "live" desktop, run entirely off the CD or USB stick. Once you're booted up, try connecting to the internet from the network icon in the upper-right—it helps during the installation process, ensures your network is working, and gives you something to do (Firefox) while the system installs.
Click the "Install" link on the desktop, and fill out the necessary language/location/keyboard info (most U.S. users can skip through the first 3 screens). When you hit the "Prepare disk space" section, select the "Specify partitions manually" option, then hit Forward. Select the free space that's after your first two Windows partitions with ntfs formats, then hit the "Add" button at bottom. Your partition should already be sized correctly, and the only thing to change is set "/" as a mount point. Here's what your screen should look like:
Link Removed due to 404 Error
Click OK, then finish through with the Ubuntu installation. If it catches your Windows 7 installation, it might ask if you want to import settings from inside it—you can, if you'd like, but I usually skip this. Wait for the installation to finish, remove the CD or thumb drive, and reboot your system.
When you start up again, you'll see a list of OS options. The only ones you need concern yourself with are Windows 7 and the top-most Ubuntu line. You can prettify and fix up this screen, Link Removed - Invalid URL, and Link Removed due to 404 Error later on. For now, let's head into Ubuntu.
We're going to make the same kind of folder access change we did in Windows. Click up on the "Places" menu, choose "Home Folder," and check out the left-hand sidebar. It's full of links to Documents, Pictures, and the like, but they all point to locations inside your home folder, on the Linux drive that Windows can't read. Click once on any of those folders, then right-click and hit Remove.
Link Removed
You should see your "Storage" partition in the left-hand sidebar, but without that name—more like "100GB filesystem." Double-click it, type in the administrator password you gave when installing, and you'll see your Documents, Music, etc. Click and drag those folders into the space where the other folders were, and now you'll have access to them from the "Places" menu, as well as any file explorer window you have open.
Ubuntu won't "mount," or make available, your Windows 7 and Storage drives on boot-up, however, and we at least want constant access to the Storage drive. To fix that, head to Software Sources in the System->Administration menu. From there go to Applications, then the Ubuntu Software Center at the bottom. Under the "Ubuntu Software" and "Updates" sections, add a check to the un-checked sources, like Restricted, Multiverse, Proposed, and Backports. Hit "Close," and agree to Reload your software sources.
Link Removed
Finally! Head to the Applications menu and pick the Ubuntu Software Center. In there, search for "ntfs-config," and double-click on the NTFS Configuration Tool that's the first result. Install it, then close the Software Center. If you've got the "Storage" or Windows 7 partitions mounted, head to any location in Places and then click the eject icon next to those drives in the left-hand sidebar. Now head to the System->Administration menu and pick the NTFS Configuration Tool.
You'll see a few partitions listed, likely as /dev/sda1, /dev/sda2, and the like. If you only want your storage drive, it should be listed as /dev/sda3 or something similar--just not the first or second options. Check the box for "Add," click in the "Mount point" column to give it a name (Storage, perhaps?), and hit "Apply." Check both boxes on the next window to allow read/write access, and hit OK, and you're done. Now the drive with all your stuff is accessible to Windows and Linux at all times.
Adding swap to Ubuntu
"Swap" memory is a section of the hard drive that your system's memory spills over into when it gets full and busy. Until recently, I'd been creating a whole separate partition for it. Recently, though, I've found that swap isn't always necessary on systems with a large amount of memory, and that swap can simply be a file tucked away on your hard drive somewhere.
Follow the Ubuntu help wiki's instructions for adding more swap, but consider changing the location they suggest putting the swap file—/mnt/swap/ for the place your Storage is held—/media/Storage, in my case.
Share Firefox profiles and more
That's about it for this guide to setting up a harmonious Windows and Ubuntu existence, but I recommend you also check out our previous guide to using a single data store when dual-booting. It explains the nitty-gritty of sharing Firefox, Thunderbird, and Pidgin profiles between Linux and Windows for a consistent experience, as well as a few other dual-boot tricks.
You might also want to consider creating virtual machines with VirtualBox for those moments when you're in one OS and need to get at the other. Ubuntu is free to create as many instances as you want, of course, and Windows 7 (Professional and Ultimate) are very friendly with non-activated copies—not that either can't be otherwise activated in cases where it's just a double-use issue.