If you want to have your own Apache web server, Creating a CentOS virtual machine using VirtualBox can be an option besides using XAMPP on a Windows computer.
Any version of Windows operating system can run CentOS using VirtualBox. By following this comprehensive guide, It won't be difficult for you to create a CentOS virtual machine using VirtualBox on Windows.
As well as created a centos-7 virtual machine with hyper-v or create a windows-7 virtual machine using hyper-v, with VirtualBox, It is possible to create a virtual computer inside a physical computer so that it can run multiple OS, inside multiple virtual machines, at the same time. But, Hyper-V is only available for the Pro version of Windows, if you don't have it, You can use VirtualBox as an alternative.
List of contents:
What is CentOS
CentOS is an open-source operating system developed from source code Red Hat Enterprise Linux and built on the Linux kernel. CentOS is designed to provide a stable and free enterprise computing platform.
If you have a CentOS virtual machine, You can install and run Apache web server with it. CentOS is often used in servers and hosting, This is because CentOS is more secure and stable.
What is VirtualBox
VirtualBox is a cross-platform virtualization product developed by Oracle. VirtualBox can be installed on existing Intel or AMD based computers, either running the operating system (OS) Windows, macOS, Linux, or Oracle Solaris. For more complete information about VirtualBox, Please visit the virtualbox.org site
Preparation
To be able to create a CentOS virtual machine using VirtualBox on Windows, several requirements must be met.
Condition:
- Windows computers with Intel Processor or AMD latest.
- Memory Minimal 512 MB RAM (bigger is better).
- Hard disk space. Least sized 20 GB.
- Software VitualBox
- Software CentOS. Because the intended use is for a web server, choose CentOS-7-x86_64-Minimal-2009.iso
Creating a Centos Virtual Machine using VirtualBox
1. Using VirtualBox Manager.

After download VirtualBox and install it on your computer. You will find an icon Oracle VM VirtualBox of desktops. Double click the icon Oracle VM VirtualBox, then click New to create a new virtual machine. You will be asked to determine several virtual machine settings which will be explained in the next stage.
2. Configure Name and Operating System
In the dialog box Create Virtual Machine. The first thing you need to do in creating a virtual machine in VirtualBox is to determine the virtual machine name and operating system.

Fill in the following fields:
- on the field Name type a name for the virtual machine, for example: CentOS
- on the field ISO Image Click the triangle on the right to choose the location where you save the CentOS installation file that you have prepared.
- on the field Type And Version, choose Linux And Red Hat (this will be filled in automatically if the system recognizes the name of the virtual machine you created).
After all fields are filled in, click Next to continue
3. Preparation for Unattended Guest OS Installation
You can ignore this Preparation for Unattended Guest OS Installation section, click Next to continue

4. Hardware Configuration
In the virtual machine hardware section, the system will create a default configuration. If needed, You can make changes.

The following options are optional:
- In the field Base Memory, determine the size of memory you want to allocate, misal 2048MB
- In the field Processors, You can choose to use 1 or multiple CPUs for virtual machines.
You can also leave the options made by VirtualBox, if completed, click Next to continue.
5. Virtual Hard Disk Settings
In this Virtual Hard Disk section you may need to determine how much storage space you want to allocate, Also consider the physical hard disk capacity of your computer.

The following options depend on the current situation:
- If you have never created a Virtual Hard Disk, choose Create a Virtual Hard Disk Now, use the slider to change the Disk size, so that the operating system on the virtual machine can run smoothly, at least set it at 20GB
- If you want to use a Virtual Hard Disk that you created previously, choose Use an Existing Virtual Hard Disk File, then select the file location of your virtual hard disk.
Click Next to continue.
6. Virtual Machine Summary
After completing several configurations, This section displays a summary of the virtual machine configuration to be created.

You can rearrange or cancel if you change your mind. Click Finish to confirm
Changing Virtual Machine Settings
After creating the virtual machine, You may still be able to change some settings. In the current situation-creating a new virtual machine-you need to change some configurations so that the virtual machine can run perfectly.
1. Show Settings
To display virtual machine settings, select the name of the virtual machine you want to change and then click Settings

2. Change System Boot Order
You need to change the sequence Boot System so that the virtual machine can run the operating system installation media. To change the order Boot, Do the following steps:
- Select a section System
- In part Boot Order, change the order Boot so that the Optical Drive is in first place by clicking the up or down arrow next to it.

3. Add Optical Drive Attributes
You need to add attributes Live CD/DVD to Optical Drive so the virtual machine can perform Booting from the optical drive directly. Do the following:
- Select a section Storage
- In part Storage Devices, click on the installation optical media that you previously selected
- In part Attributes, click Live CD/DVD

4. Connecting a CentOS Virtual Machine to a Network
So that the CentOS virtual machine can connect properly to the network, You need to make sure the network configuration is appropriate for the device you have.

To connect virtual machines to the network, do the following:
- Select a section Network
- click Enable Network Adapter
- In part Attached to:, Select the adapter model you want. In this guide the selected model is Bridged Adapter so that the virtual machine can connect directly to the internet.
Running a CentOS Virtual Machine
You can try to run the virtual machine you have created. In VirtualBox Manager, click the name of the virtual machine and then click Start

The system will display the running virtual machine screen, You can interact with the virtual machine screen as you would a normal PC by clicking on the virtual machine screen.
When you are interacting with a virtual machine, Your mouse and keyboard cannot be used on the physical machine until you leave the virtual machine session. To exit the virtual machine session, press CTRL on the right. You can also change the virtual machine display to full screen.
The next step is CentOS installation process

Continue the installation process until complete. Follow the guide how to install CentOS-7.

Cover
The stage of creating a CentOS virtual machine using VirtualBox has been completed. VirtualBox is useful as an alternative if you can't enable Hyper-V in Windows 10/11. With VirtualBox, It is possible to create a virtual computer inside a physical computer so that it can run multiple OS, You can too installed Windows-7 with him.
That's how to create a CentOS virtual machine using VirtualBox on Windows. Hope it is useful.




