Create a CentOS VM in Proxmox and set up networking

Estimated reading time: 4 min

Introduction

Proxmox VE is an open-source virtual environment for KVM virtual machines. In this tutorial, we will learn how to create a virtual machine on a freshly installed Proxmox VE server. We will learn to upload ISO of CentOS 8/7/6. Finally, we will also learn to configure basic networking so that your VM can connect to the internet.

Prerequisites

  • Snel Dedicated Server with Proxmox VE operating system installed.
  • ISO image file of the CentOS operating system you want to install. You can download that from the CentOS website.

Step 1: Log in to your Proxmox web GUI

Find out the primary IP address of your server from the service details page of your server in the snel client area.

Snel Server Details

From your favorite browser, go to https://your-ip-address:8006. Instead of the IP address, you may also use the auto-generated server domain name found on the same page. Eg. sxxxx.hosted-by-snel.com.

Make sure to type https as Proxmox GUI is only available over a secure connection. You may get a warning by the browser that certificate is not trusted, click on advanced, and proceed to the Proxmox web interface.

In the Proxmox GUI login page, enter root as username and password from the service details page of the snel client area. Leave the Linux PAM standard authentication in realm dropdown and click on the Login button to log in.

Proxmox login

Step 2: Upload ISO to Proxmox VE

After logging in, on the left side panel, you will see the node managed by Proxmox. Expand the node to see the list of attached local disks.

Proxmox Disks

Now, click on the local disk from the left side pane and then click on the Content tab to see the list of ISO and container images. On a fresh installation, you won’t see any ISO images.

Click on the Upload button from the content section.

Click Upload

This will open up the upload popup. Select ISO image from the content dropdown and select the ISO file you want to upload. Click the Upload button to upload the ISO file.

Upload Iso

Once the upload finishes, you will see the ISO file in GUI.

Uploading Finished

Step 3: Create a Virtual Machine

Now that we have the ISO file uploaded, click on the Create VM button from the top.

Create VM

This will open up a pop-up to create a virtual machine.

Create VM: General

On the General tab, provide any Name to your virtual machine. You can use the default values for other fields. Click Next to go to the OS tab. Select local storage and choose the ISO image you have uploaded. On Guest OS type, select Linux and 5.x-2.6 Kernel in the version dropdown.

Create VM: OS

Under, System tab, leave the default settings and click Next.

Create VM: System

Under the Hard Disk tab, select any storage disk and provide the guest VM disk size in GB. Make sure to enable the Discard option, this will make sure that a TRIM action in the guest OS will discard the storage space used by deleted files.

You also have the option to choose Raw disk image(raw) or QEMU image format(qcow2). raw is slightly faster than qcow2 as it has very little overhead and no associated metadata. Where qcow2 offers additions features such as compression, AES encryption, and incremental backups. Choose according to your use-case.

Create VM: HDD

Click Next to go to the CPU tab.

Under the CPU tab, select the numbers of CPU core you want to assign to the VM.

Create VM: CPU

Under the Memory tab, provide the amount of RAM you want to assign to guest VM.

Create VM: Memory

Under Network settings, leave the default settings and click Next to go to confirm tab. Review the VM configuration again and click the Finish button. You will see that the VM is created and available on the left side pane.

VM Created

Step 4: Install Operating System on VM

Click the Start button on top of your virtual machine summary interface to start the VM.

Start VM

Once the VM is running, click on the Console dropdown button and select noVNC.

Click NoVNC

This will open up a virtual console that you can use to install the operating system of your choice. Follow the operating system installer’s instructions.

Install OS

 

Your operating system installer may warn you about failed automatic networking configuration. You can proceed with the installation without a working network interface. We will configure the network once the operating system is installed.

Reboot your system once the operating system installed.

Once your server is rebooted, login into your VM again using noVNC console. Click on the Console dropdown button on top of your virtual machine summary interface and select noVNC. You should see the login screen of your VM.

CentOS 8 Login

Log in with the username and password you chose while installing your operating system.

Step 5: Set up Networking

Find out the IP address associated with your server by going to the IP management page of your server in the snel client area.
Make a note of any IP address other than the primary IP address of the host.

We will need IP addressGatewayNetwork Mask, and Nameservers in the next steps.

IP Management

Since the networking configuration of the various operating system is different hence we have listed some popular operating systems only.

Follow these instructions after logging into your VM using noVNC console. Click on the Console dropdown button on top of your virtual machine summary interface and select noVNC.

Configure network in CentOS 8

Login with the root user and switch to the network-scripts directory.

cd /etc/sysconfig/network-scripts/

Check the config file for network interface by running:

ls

You should see a network interface with the name ifcfg-ensXX (XX can be any numerical digit). Edit the file by running:

vi ifcfg-ensXX

Make the following changes to the file.

  1. Set BOOTPROTO to none.
  2. Set ONBOOT to yes
  3. Add the following lines at the end and substitute appropriate values that you got from the IP management page of your server in the snel client area.
IPADDR=128.204.192.xxx
GATEWAY=128.204.192.1
NETMASK=255.255.255.0
DNS1=89.207.128.252
DNS2=89.207.130.252

It should look like this.

CentOS 8 IP Settings

Save the file and exit from the editor. Restart the networking service by running.

systemctl restart NetworkManager

You can now skip to Step 6 and test network connectivity.

Configure network in CentOS 7

Login with the root user and switch to the network-scripts directory.

cd /etc/sysconfig/network-scripts/

Check the config file for network interface by running:

ls

You should see a network interface with the name ifcfg-ensXX (XX can be any numerical digit). Edit the file by running:

vi ifcfg-ensXX

Make the following changes to the file.

  1. Set BOOTPROTO to none.
  2. Set ONBOOT to yes
  3. Add the following lines at the end and substitute appropriate values that you got from the IP management page of your server in the snel client area.
IPADDR=128.204.192.xxx
GATEWAY=128.204.192.1
NETMASK=255.255.255.0
DNS1=89.207.128.252
DNS2=89.207.130.252

It should look like this.

CentOS 7 IP Settings

Save the file and exit from the editor. Restart the networking service by running.

systemctl restart network

You can now skip to Step 6 and test network connectivity.

Configure network in CentOS 6

Login with the root user and switch to the network-scripts directory.

cd /etc/sysconfig/network-scripts/

Check the config file for network interface by running:

ls

You should see a network interface with the name ifcfg-eth0. Edit the file by running:

vi ifcfg-eth0

Make the following changes to the file.

  1. Set BOOTPROTO to none.
  2. Set ONBOOT to yes
  3. Add the following lines at the end and substitute appropriate values that you got from the IP management page of your server in the snel client area.
IPADDR=128.204.192.xxx
GATEWAY=128.204.192.1
NETMASK=255.255.255.0
DNS1=89.207.128.252
DNS2=89.207.130.252

It should look like this.

centos 6 network config

Save the file and exit from the editor. Restart the networking service by running.

service network restart

Step 6: Test Network Connectivity

If you have successfully configured your networking, try pinging google.com now to see if you are connected to the internet.

ping google.com

You should see a successful response.

Ping Test Google

Conclusion

In this tutorial, we learned how to create a virtual machine of CentOS 8/7/6 operating system into Proxmox VE. We also learned how to upload the ISO file before creating the VM. Once the VM running, we successfully set up networking to connect the VM to the internet.

Was this article helpful?
Dislike 0
Views: 81

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *

snel-knowledgebase