Create a CentOS VM in Proxmox and set up networking

Estimated reading time: 4 min

CentOS in Proxmox and network setup

In this tutorial, you will learn how to create a virtual machine on a freshly installed Proxmox VE server. Furthermore, you will also learn how to upload an ISO of CentOS 8/7/6. Finally, you will learn how to configure basic networking in order to make a connection to the internet.

Prerequisites

  • A Dedicated Server with Proxmox VE OS installation
  • An ISO image file of the CentOS version that you would like to install. It is possible to download it via the CentOS website.

Step 1: Log in to your Proxmox web GUI

Look for the primary IP address of your server via the service details page of your My.snel.com client area.

Snel Server Details

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

Type https because Proxmox GUI will only be  available over a secure connection. You may see a warning by the browser that certificate is not safe. If you see this you can click on advanced, and then proceed to the Proxmox web interface.

Enter root as username in the Proxmox GUI login page, and find the password in the service details page of  your My.snel.com client area. Leave the Linux PAM standard authentication in realm dropdown and click on Login

Proxmox login

Step 2: ISO upload to Proxmox VE

Look at the node that is managed by Proxmox and expand this in order to see a list of attached local disks.

Proxmox Disks

After you have done this, you can click on the local disk and then click on the Content tab to see the list of ISO and container images. You will not see the OS images on a fresh installation.

Click on the Upload button from the content section.

Click Upload

Select ISO image from the content dropdown and select the ISO file you want to upload. In order to upload the file, click on Upload.

Upload Iso

You will get the see the ISO file in GUI.

Uploading Finished

Step 3:  Create a VM

Click on Create VM.

Create VM

You will see a popup that allows you to create a virtual machine.

Create VM: General

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

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

 

You may receive a warning from your operating system installer regarding failed automatic networking configuration. If you see this, you can still proceed with the installation without a working network interface. The network can also be configured after the OS installation.

Reboot your system after the OS installation.

Log in to your VM again using noVNC console. After that, click on the Console dropdown button and select noVNC. This will allow you to 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 that belongs to your server via the IP management page of your My.snel.com client area.
Take notes of any IP address other than the primary IP address of the host.

You will need the following information in the next steps IP addressGatewayNetwork Mask, and Nameservers.

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

Restart the networking service by running.

systemctl restart network

You can now skip to Step 6 and test the network connectivity of your server.

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 the following command:

vi ifcfg-eth0

Please make the changes below 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 similar to this:

centos 6 network config

Save the file and restart te networking service by running the following command:

service network restart

Step 6: Test The Network Connectivity of your VM

After configuring your networking, ping google.com in order to see if your server is connected to the internet. 

ping google.com

You should see a successful response.

Ping Test Google

Conclusion

That’s all for this tutorial,  you now know how to create a virtual machine of CentOS 8/7/6 into Proxmox VE. You also know how to upload the ISO file before creating the VM. 

Was this article helpful?
Dislike 0
Views: 23808

Reader Interactions

Leave a Reply

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