Getting Started With Linux

So You're Ready to Start Using Linux That's great! Linux is a very capable operating system. It has whatever you want for a desktop system — complete office suites including LibreOffice, Gnumeric, and other components. It includes several web browsers and e-mail tools, media players for listening to music and watching movies, and much more. Of course the operating system itself and the applications are free, and it runs well on low-cost hardware. Let's get you started by choosing a distribution and a platform.

Choosing a Linux Platform You have several choices for where and how to run Linux. You can: Boot your current desktop or notebook computer from live media.

Install Linux on a spare desktop or notebook computer.

Install Linux on a Raspberry Pi, a single-board computer just 86×54 mm (3.39×2.13") and costing about $35.

Install Linux on a virtual machine and run it within a window on your current desktop or notebook computer.

Rent a Linux cloud server for a few cents per hour. Live media on your current system This will be the fastest, cheapest, and easiest way to get started. Simply download an ISO image of a live DVD, burn that onto a DVD or write it into a USB thumbdrive, and you should be ready to go. Reboot your system, going into the firmware setup to make sure it will boot from the media you just created. The only trick is that the large file you downloaded is an image of a file system. The most common error is to create a DVD or USB that has a file system with that ISO image file sitting there as one very large file. Be sure to select the option to burn an image if you are making a DVD. "I and my friends only have Windows, no Linux or OS X.

Show me the Windows solution!"

[ JUMP AHEAD ] If you are going to use a USB thumbdrive, you can simply write the ISO image onto that device. Or at least it's easy and simple on Linux and Apple's OS X. If you or a friend have Linux or OS X, you can use this method. If you only have Windows, then jump to the Windows-only solution. Let's see how to do this in Linux or OS X. First, see what block devices are there before plugging in the USB device: $ ls /dev/sd* Disk devices on OS X are named disk1 , disk2 , and so on, and their partitions (slices) are disk1s1 , disk1s2 , and so on. You could also use the command drutil status . All the devices named sda , sdb , and so on are the disks in your system. Those names with numbers are the partitions on those disks: sda1 , sda2 , and so on. We just want to look at the disks themselves, so let's list just those devices: $ ls /dev/sd? * matches any string.

? matches one character. Now plug the USB device in and run that same command again to see what has newly appeared. If you initially saw just sda and sdb , and sdc only appeared after you plugged in the USB device, then the first two are the permanently installed disks and sdc is the USB device. On some distributions, if you are logged in on the graphical console then you have permission to write data onto a USB device you plugged in. Try this command, it will work if you have the needed permission. Change /path/to/image.iso to the path to the ISO image file, and change sdX to the USB device name. If this works, it will take a while. Be patient and wait for the command to finish. $ dd if=/path/to/image.iso of=/dev/sdX bs=1M If the above command fails with an error message about "No such file or directory", then you are doing something wrong. You need to be very careful when you are doing this. Re-read the above, starting at "Let's see how to do this" and try it again. If the command fails with a message about running out of space, then you need to use a larger USB thumbdrive! Be careful! UNIX was not designed to keep you from doing stupid things, because that would also keep you from doing clever things. The power, and the danger, is that it does exactly what you ask as long as you have the needed permissions. If the command fails with a message about "Permission denied", then you need to use a technique that is much more powerful but also dangerous. Just like a chainsaw... Make absolutely certain that you are using the appropriate device name for the USB thumbdrive. Getting this wrong will destroy all your data and the operating system if you accidentally specify the internal disk holding that data. On an Ubuntu-derived system, the first way of doing this will work. On others, you will need to use the second version and type the root password when asked: $ sudo dd if=/path/to/image.iso of=/dev/sdX bs=1M Or, if that doesn't work: $ su root -c 'dd if=/path/to/image.iso of=/dev/sdX bs=1M' Yes, the syntax of dd is a little odd. It dates from way back in UNIX history, maybe from when people hadn't yet decided how things generally should be done. As for those parameters:

if= specifies the input file (or device)

of= specifies the output file (or device)

bs= specifies the block size. 1 megabyte blocks make this go way faster than the default 512 byte blocks. Windows lacks handy tools like dd . So, you may need to install someone's graphical tool and point and click through some windows and menus, as described and shown on this Ubuntu page. Or, you could use something like the traditional RAWRITE.EXE tool. Graphical versions can be found here, here, and here. There are two potential disasters with the live ISO image approach. First, you (or someone who looks at your system while you stepped away while it's running the live image) might click the button that says "Go ahead and install this, wiping out all data on the disk." After all, most live images are designed to make everything very easy, including installing onto the hardware. Second, if you plan to do this during lunch time on your system at work, you might find that the IT security staff suddenly appears demanding to see the unauthorized device suddenly connected to the enterprise network. This approach is easy, but be careful. Install Linux on a spare computer This should be the easiest and least frustrating method once you get the hardware put together. And, you very likely already have a suitable platform just waiting to be used. Don't make it hard for yourself. Use a computer you recently replaced with a newer model? Sure. Just don't try to use some really outdated hardware that you're not really certain whether it actually works or not. Watch out, laptop built-in wireless network interface support is the sketchiest thing in all of Linux. The manufacturers of those chip sets frequently give all the details to Microsoft but to no one else. As for using low-end hardware, I had CentOS 5 running on a Pentium III (930 MHz) CPU with 512 MB RAM until 2014. Full updates for CentOS 5 had ended the first quarter of 2014. No, I didn't try to do very much with that system. But it had some uses. Applications grow ever more memory-hungry. I did not try to upgrade it to CentOS 6, because of the limited memory. I'm not sure if an on-line upgrade to CentOS 6 would have worked. A fresh install of RHEL 6 required 2 GB of RAM, four times what that system had. Red Hat's installer refuses to work on a system that they expect to provide unsatisfactory performance. If you don't have a suitable spare machine sitting around, you don't have to buy a new computer or the parts to assemble one. Not a full-sized computer, anyway, as you can... Install Linux on a Raspberry Pi The Raspberry Pi is a small single-board computer designed in the U.K. for teaching basic computer science and programming in Python and other languages in elementary through high schools. It's not just the U.S., as Myanmar (ex-Burma) also uses non-metric measurements. It's small, just 86×54 mm. That's 3.39×2.13 inches in the U.S., where a national program to teach computer science and Python programming to children is a fantastical concept. The Raspberry Pi itself costs about $35. You will also need an Android type charger. Get one that can provide 5V DC at a solid 1 A or 1000 mA, or more. And, you will need a flash memory card. Early models used SD, which typically means a MicroSD card in an SD adapter. The Raspberry Pi uses MicroSD directly, starting with the B+ model. You need a bare minimum of 2 GB of storage for the bootable OS, but you will probably want at least 8 GB. You can connect a USB keyboard and an HDMI cable leading to a computer monitor or television. You likely already own much of the collection of added parts including the charger, MicroSD, USB keyboard, and HDMI cable. The Raspberry Pi has one Ethernet port, an onboard 802.11 wireless interface, and it runs SSH by default. So, you can plug it into your LAN or WLAN and connect into it over SSH, maybe using PuTTY from Windows. Why do you have to add software from some guy's site? Because an SSH client is an important security tool, and so one isn't included in Windows. Come join the Linux movement, and you too can be dismissive of poorly designed but expensive software. I own and use several Raspberry Pis, and most of them have had a keyboard or display connected. I have only used them by connecting in over SSH. When I got the second one I thought I should see what the keyboard and display experience was like. It looked very sharp on my large television display. But then I went back to exclusively using them by connecting in over SSH. Here are two early Raspberry Pi cards, stacked in a small case that still is about twice as wide as really needed. Install Linux on a virtual machine I have left this approach until the end, as it seems to me to be the most complex for what you get out of it. But that's just relative complexity, even this isn't too bad at all. Oracle's VirtualBox is free and easy to use. This way you can run a Linux system within a window on your macOS or Windows desktop. VMware's VMware Player is another free virtualization product. VirtualBox and VMware Player are both Type 2 virtualization. The hypervisor that does the virtualization runs as an application on top of a full operating system. For most people, this means that Windows runs on their hardware, a virtualization hypervisor runs as an application on Windows, and the "guest" operating system runs within that. VMware ESXi and vSphere is a Type 1 virtualization product. ESXi is a "bare metal" hypervisor, running directly on the hardware, and vSphere does the orchestration to use cloud technology within your data center. It is also available for free, but if you're already using vSphere then I can't imagine you reading this page because you can't figure out how to run Linux. Your Linux operating system and the applications running there would be the next-to-top and top boxes, respectively, in these diagrams: Applications Guest operating system Type 1 hypervisor Hardware Applications Guest operating system Type 2 hypervisor Host operating system Hardware Install VirtualBox, create a new blank virtual machine image, connect your Linux distribution install media as the virtual optical drive, and start the virtual machine to install into the blank system. Finally, although we're getting more complicated and ending up with a more constrained Linux system here, you can install the QEMU virtualization software plus a virtualized Linux system on a USB thumbdrive. You can also do this on a system with BSD running on the hardware. But, if you're already running BSD then I can't imagine you not being able to figure out how to install Linux somewhere. Then you can plug that thumbdrive into a system running Windows or Linux on the hardware. The thumbdrive has QEMU executables for both Windows and Linux, you run the appropriate one and your Linux system boots inside a window on the desktop. Of course, someone absolutely concerned with security would have to worry about memory pages of the QEMU process being paged out to disk. But for what I was doing, this was plenty secure enough. I used this on a trip to Mexico. I had my own Linux machine along for the trip, but all I had to carry was a USB thumbdrive. I could go into a local cybercantina, plug in my thumbdrive, and get my virtualized machine onto the Internet. I could download and save e-mail messages and files. They weren't saved to the physical disk in the hardware, they went into and left with my thumbdrive. Rent a Linux cloud server The big cloud computing providers will rent you a Linux machine for just a few cents per hour. You're looking for their IaaS or Infrastructure as a Service offerings. These would be Amazon Web Services' EC2, Digital Ocean's Droplets, Google's Compute Engine, and Microsoft Azure Virtual Machines. Yes, Microsoft rents Linux servers in their cloud operation. In mid 2016 they announced that over the past year Linux had risen from 25% to 33% of IaaS service they were selling. IaaS Cloud Provider per hour Google Compute Engine Free Amazon Web Services EC2 $0.0065 Digital Ocean Droplet $0.0068 Microsoft Azure $0.018 Google Cloud gives you one one free VM instance, you only have to pay for outbound bandwidth beyond 1 GB per month. This web site runs on Google Cloud, I pay just about $5-7 per month for the bandwidth. If you are just using the system to practice with the command line, you aren't going to move 1 GB out through your command prompt! If you're in Australia or China, you have to start paying for bandwidth immediately, but it would take a lot of command-line use to run up more than a few cents per month. Amazon Web Services gives you 750 hours per month (that's one machine running continuously) for free for the first year after you sign up. Then you have to start paying as shown in the table. When you have to pay, you don't have to pay very much. The table shows the lowest priced IaaS offerings the last time I looked them up. Prices change, they tend to go down. You will need to set up an account. If you have ever purchased anything through Amazon, you are part way there already and you can set up your account for AWS use in a few minutes. You will need to generate a key pair. Only the public key is stored at Amazon, you keep the private key. You can generate the key pair through Amazon's interface and save the private key on your Windows machine. Or, you can generate a key pair on your machine using PuTTYgen. Deploying the cloud server is a matter of making selections and clicking through a number of web pages. It will take you a while the first time you do it. But once you're familiar with the process, it's a minute or less of clicking through the screens and then about 20 to 30 seconds for your cloud server to be deployed and started. Then you're ready to connect to it with an SSH client using that private key! Don't forget to shut down the cloud server when you're done! You keep getting billed as long as it runs, whether you're using it or not. They're cheap per hour but it adds up. Beware, cloud servers can be rebooted, but on some platforms (e.g., AWS), if you shut them down they are destroyed. That is, unless you pay more for persistent storage. Google also gives you 30 GB of persistent storage.

I Didn't Even Mention Dual-Booting Yes, you can squeeze Windows to the side and install Linux or another operating system in parallel. At boot time you choose which operating system to run. So, you could run one for a while, then shut it down and boot the other, switching back and forth. But with free virtualization built into the Linux kernel, and with free virtualization products available from VMware, I just can't see doing this just to have both Windows and Linux on the same system. If you're interested, I have a page explaining how to set up multi-booting. That page shows how I have set up a dual-boot Windows / OpenBSD system. QEMU can do virtualization on top of OpenBSD, so I could have OpenBSD installed on the hardware and Windows running within a QEMU virtual machine. I have done that, this page shows how. However, my current laptop has an Intel CPU lacking their VT-x virtualization support, so performance is unacceptable. I don't need to use Windows very often, so multi-booting suits my needs. You have to be very careful when you set up multi-booting. Windows always assumes that it's the only operating system, and it will "update" or "correct" the boot loader when you install a service pack. My Windows-OpenBSD dual booting howto shows how I avoid that problem.