Create a Debian VM in Proxmox and set up networking

Estimated reading time: 4 min

How to create a Debian VM in Proxmox and configure networking

This tutorial will teach you how to create a virtual machine (VPS) on a freshly installed Proxmox VE server. You will learn how to upload an ISO of your choice from Debian. Lastly, you will also learn how you can configure basic networking in order to connect your VM to the internet.

Prerequisites

  •  A Dedicated Server from Snel.com with Proxmox VE operating system installed.
  • ISO image file of Debian OS. You can download the file from the Debian website or you can purchase it at Snel.com.

Step 1:  Log in to the Proxmox web GUI

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

Snel Server Details

Open your browser and navigate to https://your-ip-address:8006. If you wish, you can also use the auto-generated server domain name instead of using the IP address. This can be found on the same page. Eg. https://sxxxx.hosted-by-snel.com:8006.

Don’t forget to type https because Proxmox GUI is only available over a secure connection. It is possible that you will see a warning that says that the certificate is unreliable. If this occurs, you can click on advanced, and then proceed in the Proxmox web interface.

In the Proxmox GUI login page, type root as username and the password from the service details page that can be found in your My.snel.com client area. Leave the Linux PAM standard authentication in the dropdown and click to the Login button in order to log in.

Proxmox login

Step 2: ISO upload to Proxmox VE

After you’re logged in, on the panel on the left side, you will see the node managed by Proxmox. Enlarge the node to see the list of attached local disks.

Proxmox disk

 

 

After this step, you can click on the local disk from the panel and then click on the Content tab to view the list of ISO and container images. You will not see ISO images on a new and fresh installation.

Click on the Upload button from the content section.

Click Upload

Select ISO image from the content drop-down. After this, you can select the ISO file that you would like to upload. Click the Upload button in order to upload the ISO file.

Upload Debian ISO

Once the uploading is finished, you will get the see the ISO file in GUI.

ISO Uploaded

Step 3: Creating a VM

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

Create VM

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

Create VM: General

On the tab General provide your Virtual Machine a Name . You are allowed to use the default values for the other fields as well. Click Next to go on to the OS tab. After that, select local storage and choose the ISO image that you uploaded. On Guest OS type, select Linux and 5.x-2.6 Kernel in the version dropdown.

Create VM: OS

Leave the default settings under the System tab and click Next.

Create VM: System

Under the Hard Disk tab, choose a storage disk, it doesn’t matter which one you choose.  Make sure you give the guest Virtual Machine disk size in GB. Check the Discard option, this will make sure that a TRIM action in the guest OS will remove 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 a little bit faster than qcow2 as it has very little overhead and no associated metadata. Where qcow2 offers extra features such as compression, AES encryption, and incremental backups. Choose based on your use-case.

Create VM: HDD

Click Next to go to the CPU tab.

Under the CPU tab, select the amount of CPU cores you want to give to the Virtual Machine.

Create VM: CPU

Under the Memory tab, provide the amount of RAM you want to give to the guest Virtual Machine.

Create VM: RAM

Under Network settings, leave the default settings, and click Next to go to the Confirm tab.

Create VM: Network

Review the Virtual Machine configuration once more and click the Finish button. You will see that the Virtual Machine is created and available on the panel at your left.

VM Created

Step 4: Install the OS on your VM

Start the Virtual Machine by clicking on the Start button which can be found at the top of your virtual machine summary interface.

Start VM

If the Virtual Machine is running, you can click on Console and then select noVNC.

Open noVNC Console

 

A virtual console will be opened which will allow you to install the OS of your choice. Follow the instructions accordingly.

Install Debian

There’s a chance your operating system installer will warn you about a failed automatic networking configuration. You can go on with the installation without a working network interface. We will configure the network after the operating system is installed.

Restart your system after the operating system is installed.

Once your server has restarted, login into your Virtual Machine again using the 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 Virtual Machine.

Debian VM Login

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

Step 5: Configure Networking

Find out the IP address connected 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’re going to need the IP addressGatewayNetwork Mask, and Nameservers in the next steps.

IP Management

 

On the noVNC terminal, look up the name of the ethernet device by running ip add. It should show you two interfaces, one lo, which is the loopback interface. Ignore this one and note the name of the other interface in format ensXX.

Find Interface

Edit the network configuration file.

vi /etc/network/interfaces

Add this following line at the end.

auto ens18
iface ens18 inet static
address 128.204.192.xxx
netmask 255.255.255.0
gateway 128.204.192.1
dns-nameservers 89.207.128.252 89.207.130.252

Make sure to change ens18 to your ethernet device name. Also, replace the appropriate values that you got from the IP Management page of your server in the Snel client area.

Network Config

Save the file and close the editor.

Bring the device up by running

ip link set ens18 up

Restart the network by running the following command:

systemctl restart networking

If resolvconf is not installed, you will need to add nameservers to /etc/resolv.conf file.

See if resolvconf is not installed by running:

apt -qq list resolvconf

Not getting an output means that the package is not installed on your server. If you do get some output then it means that the package is installed so this allows you to proceed to Step 6.

Open /etc/resolv.conf file using:

vi /etc/resolv.conf

Make sure your add these lines into the file:

nameserver 89.207.128.252
nameserver 89.207.130.252

Save the file and close the editor.

Step 6: Test the Network Connectivity

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

ping google.com

You should see a successful response.

Ping Google

Conclusion

In this tutorial, you have learned how to create a VM with Debian in Proxmox VE. This tutorial has also guided you in how to upload the ISO file before creating the Virtual Machine. Furthermore, you have learned how to connect your VM to the internet.

Was this article helpful?
Dislike 8
Views: 63856

Reader Interactions

Leave a Reply

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