How do I “install” CentOS?

Taking my first Linux course and, ironically, I think I’ve hit a problem that could be fixed by someone proficient in Linux!

As part of the course I’m taking, we’re required to download and install CentOS 7. I’m having problems with the installation part.

Some context:

  • Downloaded the ‘DVD ISO’ file from official website
  • File name: CentOS-7-x86_64-DVD.iso
  • File size: 4.33 GB
  • Running OS X El Capitan v10.11

However, when I double-click on the file I get the following error:

The following disk images couldn’t be opened:
Image: CentOS-7-x86_64-DVD-1511.iso
Reason: no mountable file systems

I would delete and download the file again but I don’t have a stable and/or fast connection, so I would rather not do that as it is a real pain.

Is there a way to fix this? I did some research online and didn’t find satisfying solutions. My first thought was perhaps the file is corrupted due to my bad connection but it seems to be a common problem, so perhaps it isn’t that?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Linux (and Unix for that matter). Are operating systems.


What is an Operating System?

An Operating system (OS) is the software that runs “directly” (let’s ignore firmware for now) on your computer’s hardware, and provides a standard environment from which other software can run. Usual programs/apps, such as itunes or microsoft word don’t want to deal with your actual hardware, they simply ask the Operating System for something, it deals with the hardware, and gives the result back to the program/app.

Operating systems are thus installed outside of other operating systems (since they’re used to access the computer’s hardware directly).

Your MAC would already be running macOS as its Operating System, Apple’s Operating System for its devices.

Usually as the computer starts up you can change which device it starts, and choosing an operating system installation DVD or USB drive is a common method for installing a new Operating system.

This means that an operating system can’t really be “installed” on another operating system, but there are workarounds.


Dual Booting

“Dual Booting” refers to installing multiple Operating Systems on a single computer.

This is easiest if you have multiple hard drives so that you can install Operating Systems on their own hard drive, then simply choose which hard drive to boot.

You can also install multiple Operating Systems on a single hard drive, but that requires a boot manager (software that figures out where on the hard disk each Operating System starts).

I wouldn’t recommend this method for a MAC, simply because they aren’t really meant to run anything except macOS, and I wouldn’t trust other OS’s to support them.


Virtual Machines

Virtual Machines are programs that run within an Operating System that pretend to be a full computer. Because they pretend to be a computer you can install an operating system on them!

The most common Virtual Machine program is likely VMware, but you can search around to find one you like.

Method 2

To install centos you need

  1. A virtual machine for try Centos,on Mac os you can try
    virtualbox or parallel.
  2. Try directly on a pc,but will erase your current os
    or you can partition hard disk and get dual boot,or install
    on different internal or external hd(linux can run on usb devices,of course usb3,usb2 works but is really slow)

Is impossible to run linux by click on dvd dmg/img!
Maybe in the future…

Method 3

You could try running the Linux OS from a USB drive?

https://www.ubuntu.com/download/desktop/create-a-usb-stick-on-mac-osx

Method 4

To install Cent-OS or any other distribution of linux or windows, there are 2 ways in general. To install it directly on a hard drive or install it on a hyper-visor. To install it directly on a hard drive. You have a macbook, then you should download and install a hyper-visor first.

A choice for hyper visor on macbook is Parallels Desktop, or VMware Fusion.

Their job is to create a virtual computer for you. You can specify RAM, CPU and other specifications to your virtual computer. Then it ask you: which do you want to install on it. Then you select that .iso file for cent-OS. After installing and turning it on, You have a new virtual computer with you custom OS installed on it and also have you OSx running side by side. It’s called virtualization.

Method 5

VirtualBox is certainly the simplest way to start your Linux learning experience. However, if you want to learn the Linux command line, you may not want to go through installing the operating system through a graphical interface on a CD just to get started. (It’s good to go through the install process from a CD at least once, but it’s not necessary if you just want to play with a Linux command line.) So I recommend you use VirtualBox in combination with Vagrant.


For the fastest route to accessing the command line on an actual CentOS installation on your Mac, I recommend you do the following:

  1. Download and install VirtualBox.
  2. Download and install Vagrant (to allow you to create disposable virtual machines.)
  3. Open your “Terminal” (found in /Applications/Utilities on a Mac).
  4. Create a new directory to hold all your vagrant files by typing the following and pressing enter:
    mkdir vagrant
  5. Go into that directory—Change your Directory to that directory—by typing the following (and pressing enter):
    cd vagrant
  6. Create a directory to hold files relating to a particular virtual machine that you are about to create. For instance:
    mkdir centos-6
  7. Change Directories into that directory:
    cd centos-6
  8. Initialize the “Vagrant environment”, specifying what virtual machine “image” (saved snapshot state of a computer) you want to start with when you create a virtual machine from this directory:
    vagrant init centos/6
  9. Create the virtual machine, based on the CentOS 6 vagrant box “image” which you specified in the last command.
    vagrant up

    This will take a little while this first time, as your computer will have to download the virtual machine “image” with CentOS 6 already installed on it. It will help if you have a good internet connection. It won’t take this long every time, just the first time.

  10. Log in to the virtual machine you’ve now created, using the Secure Shell protocol (SSH):
    vagrant ssh

That’s it. You are now on a fully fledged CentOS 6 installation, running inside a virtual machine on your computer. You can do whatever you want to inside this machine, and it won’t negatively affect the files on your “host” computer (your Mac).


When you’re done on the machine, you can get back to your own computer very easily:

exit

However, your virtual machine will still be running. To shut it down without removing it, run (from your own computer, not from inside the virtual machine):

vagrant halt

To wipe out that particular virtual machine (so that the next time you vagrant up you will have a brand new virtual machine without any changes you have made inside the last one), you can destroy it by running:

vagrant destroy

If you want a different kind of Linux OS, you can find a wide selection of Vagrant boxes available online. Many of them are user-contributed and may have odd combinations of software installed or not installed on them.

In general (and for learning purposes) I recommend using the official boxes for the OS you are using, until you have a need to use something different:


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x