<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>vps-setup — LowEndSpirit</title>
        <link>https://lowendspirit.com/index.php?p=/</link>
        <pubDate>Mon, 06 Apr 2026 18:39:46 +0000</pubDate>
        <language>en</language>
            <description>vps-setup — LowEndSpirit</description>
    <atom:link href="https://lowendspirit.com/index.php?p=/discussions/tagged/vps-setup/feed.rss" rel="self" type="application/rss+xml"/>
    <item>
        <title>How to Create and Setup a Debian KVM VPS with Proxmox VE 6 -- Part III -- Network Configuration</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3933/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-iii-network-configuration</link>
        <pubDate>Fri, 23 Jul 2021 12:00:00 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">3933@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/Not_Oles" rel="nofollow">@Not_Oles</a>, 23 Jul 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/n9/cixat1djj0ag.png" alt="image" />
</p>

<h2>I. Before We Start</h2>

<p>We need to obtain our basic network configuration from our provider. Or, if we are running our own host node, we need to assign basic network configuration to ourselves. Our basic network configuration might look something like this:</p>

<table>
<thead>
<tr>
  <th><strong>Item</strong></th>
  <th><strong>Value</strong></th>
</tr>
</thead>
<tbody>
<tr>
  <td>IPv4 address</td>
  <td>172.16.165.97/28</td>
</tr>
<tr>
  <td>Netmask</td>
  <td>255.255.255.240</td>
</tr>
<tr>
  <td>Broadcast</td>
  <td>172.16.165.111</td>
</tr>
<tr>
  <td>Gateway</td>
  <td>172.16.164.1</td>
</tr>
</tbody>
</table>

<p>For IPv6, one might expect something like:</p>

<table>
<thead>
<tr>
  <th><strong>Item</strong></th>
  <th><strong>Value</strong></th>
</tr>
</thead>
<tbody>
<tr>
  <td>IPv6 address</td>
  <td>fe80::/64</td>
</tr>
</tbody>
</table>

<p>But occasionally, IPv6 could be something like:</p>

<table>
<thead>
<tr>
  <th><strong>Item</strong></th>
  <th><strong>Value</strong></th>
</tr>
</thead>
<tbody>
<tr>
  <td>IPv6 address</td>
  <td>fe80:xxxx:xxxx:xxxx::97/128</td>
</tr>
<tr>
  <td>Gateway6</td>
  <td>fe80:xxxx:xxxx:xxxx::3</td>
</tr>
</tbody>
</table>

<p>Notes:</p>

<ul>
<li>The /28 in the IPv4 address and the longer netmask are <a rel="nofollow" href="https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing#:~:text=CIDR%20notation%20is%20a%20compact,bits%20in%20the%20network%20mask.">different ways of providing the same information about the size of the local, directly connected network.</a> It suffices for us to have this information in one format or the other. We don't need both formats because the information is the same. Also, the broadcast IP might not be provided, since it isn't strictly necessary.</li>
<li>For the second format of the IPv6 address, <strong>what happened to the /64</strong>? 😱 The /128 in the second form of the IPv6 address might seem <strong><em>clueless</em></strong> to IPv6 fans expecting a /64. Also, the second format of the IPv6 address includes a gateway6 address. The gateway6 address might seem strange to some IPv6 fans, but we need the gateway6 for our minimal, static configuration. More on all this below.</li>
</ul>

<h2>II. Introduction</h2>

<p>In <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-ii-debian-install/">the previous post of this series</a> we finished using the Proxmox web GUI to install our new Debian KVM VPS via the <a rel="nofollow" href="https://www.debian.org/CD/netinst/">Debian netinst installer iso image.</a> The final step in Part II was removing the netinst install iso image from the emulated cdrom and then reooting our new VM, which came up from its own internal filesystem:</p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/hs/2qx8afaew937.png" alt="" title="" /></p>

<p>In today's post, we continue from this exact place where we left Part II -- connected to our newly installed and newly rebooted KVM via the Proxmox web GUI. In this post, we will accomplish the networking configuration which was skipped in Part II because the <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/63101/#Comment_63101">Debian netinst iso doesn't automatically configure out of band IP addresses.</a></p>

<p>There are three network configuration and related tasks we will accomplish today:</p>

<ul>
<li>First, we go "inside" our VM through the Proxmox web GUI's emulated "physical" console connection and set up networking. In Debian, networking setup requires that we adjust the file /etc/network/interfaces to tell our VM its network address and the address of its gateway to the internet.</li>
<li>Second, we edit the file /etc/resolv.conf to tell our VM the numerical addresses of <a rel="nofollow" href="https://en.wikipedia.org/wiki/Domain_Name_System">Domain Name System ("DNS")</a> servers it can use to translate human readable <a rel="nofollow" href="https://en.wikipedia.org/wiki/Uniform_Resource_Identifier">Uniform Resource Identifiers (URI)</a> into numerical <a rel="nofollow" href="https://en.wikipedia.org/wiki/IP_address">Internet Protocaol ("IP") addresses.</a></li>
<li>Third, we set up /etc/apt/sources.list to tell our system's <a rel="nofollow" href="https://www.debian.org/doc/manuals/debian-faq/uptodate.en.html">Aptitude software package manager ("APT")</a> where to get software updates and the additional software packages we will want to install.</li>
</ul>

<p>Section III, Quick Setup, runs quickly through all three of today's tasks in "recipe style."</p>

<p>Section IV offers additional context on our setup environment.</p>

<p>Sections V, VI, and VII provide additional details on today's three setup tasks.</p>

<p>Section VIII discusses security.</p>

<p>Section IX discusses backup.</p>

<p>When we finish the Quick Setup, our new Debian KVM VPS should be connected to the internet, DNS should work, and we should be able to use the Debian package system to add whatever additional software we want.</p>

<p>When we finish all of today's post, we should have reasonable context within which to understand our Debian VM's networking setup.</p>

<h2>III. Quick Setup</h2>

<p>Logged into our VM through the Proxmox web GUI, we run the command <code>ip link show</code>. This command will give us the name of our network interface, probably something like "ens18."</p>

<p>As root or with <code>sudo</code>, we edit the text of the file /etc/network/interfaces so that it contains the minimum necessary information:</p>

<pre><code>auto ens18
iface ens18 inet static
  address IPv4_ADDRESS/CIDR
  gateway GATEWAY_ADDRESS

iface ens18 inet6 static
  address IPv6_ADDRESS/CIDR
  gateway GATEWAY6_ADDRESS
</code></pre>

<p>Using our example network configuration, our minimal /etc/network/interfaces looks like this:</p>

<pre><code>auto ens18
iface ens18 inet static
  address 172.16.165.97/28
  gateway 172.16.164.1

iface ens18 inet6 static
  address fe80:xxxx:xxxx:xxxx::97/128
  gateway fe80:xxxx:xxxx:xxxx::3
</code></pre>

<p>Second, we edit the /etc/resolv.conf file so that it looks like this:</p>

<pre><code>nameserver 1.1.1.1
nameserver 8.8.8.8
nameserver 2606:4700:4700::1111
nameserver 2001:4860:4860::8888
</code></pre>

<p>Third, we edit /etc/apt/sources.list so that it looks like this:</p>

<pre><code>deb http://deb.debian.org/debian buster main contrib non-free

deb http://deb.debian.org/debian-security/ buster/updates main contrib non-free

deb http://deb.debian.org/debian buster-updates main contrib non-free
</code></pre>

<p>Finally, we restart networking so that our new configuration takes effect:</p>

<pre><code>systemctl restart networking
</code></pre>

<p>At this point, we should have both IPv4 and IPv6 connectivity, and DNS and APT both should work.</p>

<h2>IV. More Context</h2>

<ul>
<li><strong>Virtualized Console Connection</strong></li>
</ul>

<p>The Proxmox web GUI virtualizes a wired console connection. In other words, our web browser does connect over the internet to our Proxmox server, but, the view from inside our new KVM is the same as though a wired connection was attached. Our new KVM thinks it's talking over a wired connection to a physical console. From inside our new KVM, there is, as yet, no network connection.</p>

<p>By default, the Proxmox web GUI works via <a rel="nofollow" href="https://en.wikipedia.org/wiki/Virtual_Network_Computing">VNC.</a> <a rel="nofollow" href="https://pve.proxmox.com/wiki/Serial_Terminal">In the Proxmox wiki on serial terminal</a> Proxmox warns that VNC might</p>

<blockquote><div>
  <p>not have the features you need (i.e. easy copy/paste between other terminals)</p>
</div></blockquote>

<p>or it might be</p>

<blockquote><div>
  <p>impossible to capture all &#91;kernel messages, standard output, or error&#93; messages on &#91;the&#93; VNC screen.</p>
</div></blockquote>

<p>Yep, copy / paste commands <a rel="nofollow" href="https://forum.proxmox.com/threads/copy-paste-keys-commands-for-ct-kvm-vnc-console.28037/">do not seem to work in the Proxmox KVM virtual console.</a></p>

<p>Also, if you enjoy using the vi editor, you might find what looks like a "Send-Esc" button among the set of choices within the set exposed by the top button on the console VNC control bar. Use of the real keyboard Escape key results in exiting full screen. However, a second real Esc seems to produce the expected mode change, despite that maybe we no longer can see too well without returning to full screen.</p>

<ul>
<li><strong>No DHCP, No SLAAC</strong></li>
</ul>

<p>These days most network setups use <a rel="nofollow" href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">Dynamic Host Configuration Protocol (DHCP)</a> to autoconfigure IPv4 networking. The machine on which networking is to be configured asks for and receives from a DHCP server all the needed information for the networking setup.</p>

<p>It is possible to configure DHCP so that it always returns the same IP address to each VM, but, since our entire Proxmox network is static, it may be simpler to set up networking manually--the traditional way for servers.</p>

<p><a rel="nofollow" href="https://en.wikipedia.org/wiki/IPv6#Stateless_address_autoconfiguration_(SLAAC)">Stateless Address Autoconfiguration ("SLAAC")</a> provides automatic configuration of IPv6 addresses. SLAAC requires a /64, which is why people say, for IPv6, that a /64 is expected and that less than a /64 is <em>clueless.</em> However, it remains possible to hand configure a single static IPv6 address, as we are doing here.</p>

<p>What if, for whatever reason, we simply do not want to use SLAAC? What if our provider doesn't receive enough IPv6 addresses from <em>his</em> provider to allow passing on to each VPS its own /64? What if our provider's provider charges an extra fee for extra IPv6 addresses, but we do not want to pay our provider's pass through of his provider's extra fee? What if we simply choose to use single, static IPs as is traditional for servers?</p>

<ul>
<li><strong>No Cloud-Init</strong></li>
</ul>

<p>As mentioned in <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-ii-debian-install/">the previous post of this series,</a> most VM network setups these days are done with <a rel="nofollow" href="https://github.com/canonical/cloud-init">Cloud-Init.</a> Proxmox <a rel="nofollow" href="https://pve.proxmox.com/wiki/Cloud-Init_Support">supports Cloud-Init,</a> which enables both networking and ssh access to virtual machines to be set up on the Proxmox hypervisor and outside of the VM. Cloud-init can use DHCP. Here, however, we have chosen the simplest possible manual configuration with static IPs.</p>

<ul>
<li><strong>Our Static, Routed Configuration And Out of Band Gateway From Our Provider's Provider</strong></li>
</ul>

<p>Here, our single, static IPv4 and single, static IPv6 are each derived from a <a rel="nofollow" href="https://en.wikipedia.org/wiki/Routing">routed subnet</a> assigned to our server node. However, our internet gateway IPv4 address is not included among our server's routed group of IPv4s. This is called an "out of band" gateway.</p>

<p>Besides routed subnets, it also is possible for a datacenter to assign to servers non-routed, individual IP addresses. Data for these non-routed IPs moves between the datacenter switch and server nodes via <a rel="nofollow" href="https://en.wikipedia.org/wiki/Network_layer">the "link layer."</a> Hetzner has a <a rel="nofollow" href="https://docs.hetzner.com/robot/dedicated-server/network/net-config-debian/">tutorial on Debian network configuration</a> which includes discussion of "bridged configuration" for non-routed IPs.</p>

<ul>
<li><strong>Systemd in Debian Networking</strong></li>
</ul>

<p><a rel="nofollow" href="https://lwn.net/Articles/585319/">Since about 2014,</a> networking is setup on Debian with <a rel="nofollow" href="https://en.wikipedia.org/wiki/Systemd">systemd.</a> The choice of systemd <a rel="nofollow" href="https://lwn.net/Articles/585363/">initially was</a> and <a rel="nofollow" href="https://www.howtogeek.com/675569/why-linuxs-systemd-is-still-divisive-after-all-these-years/">has continued to be divisive.</a> Nevertheless systemd has remained as the Debian default.</p>

<p>There are at least two basic variations of Debian's systemd network arrangement. The first--which seems to be the default variation for Debian systemd network configuration--at least with the netinst iso--is using systemd's networking.service. For example, by using <code>systemctl</code>, we can confirm that networking.service is what is being used on our Node:</p>

<pre><code>root@Proxmox-VE ~ # systemctl status networking.service
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: 
   Active: active (exited) since Wed 2021-06-02 19:13:13 UTC; 1 weeks 2 days ago
     Docs: man:interfaces(5)
 Main PID: 791 (code=exited, status=0/SUCCESS)
    Tasks: 0 (limit: 4915)
   Memory: 0B
   CGroup: /system.slice/networking.service

 [ . . . ]
root@Proxmox-VE ~ # 
</code></pre>

<p>Our test KVM also seems to think its networking is controlled by systemd:</p>

<pre><code>root@debian-kvm:~# systemctl status networking
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
   Active: active (exited) since Wed 2021-06-16 01:20:45 UTC; 4min 51s ago
     Docs: man:interfaces(5)
  Process: 448 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=0/SUCCESS)
 Main PID: 448 (code=exited, status=0/SUCCESS)

Jun 16 01:20:45 debian-kvm systemd[1]: Starting Raise network interfaces...
Jun 16 01:20:45 debian-kvm systemd[1]: Started Raise network interfaces.
root@debian-kvm:~#
</code></pre>

<p>As we can see, systemd networking.service calls the traditional debian <code>ifup</code> and <code>ifdown</code>.</p>

<pre><code>root@debian-kvm:~# cat /lib/systemd/system/networking.service
[Unit]
Description=Raise network interfaces
Documentation=man:interfaces(5)
DefaultDependencies=no
Requires=ifupdown-pre.service
Wants=network.target
After=local-fs.target network-pre.target apparmor.service systemd-sysctl.service systemd-modules-load.service ifupdown-pre.service
Before=network.target shutdown.target network-online.target
Conflicts=shutdown.target

[Install]
WantedBy=multi-user.target
WantedBy=network-online.target

[Service]
Type=oneshot
EnvironmentFile=-/etc/default/networking
ExecStart=/sbin/ifup -a --read-environment
ExecStop=/sbin/ifdown -a --read-environment --exclude=lo
RemainAfterExit=true
TimeoutStartSec=5min
root@debian-kvm:~# 
</code></pre>

<p>The second Debian systemd possibility--not the default on Debian netinst.iso and not used here--is systemd-networkd. Sahitya Maruvada has a simple, clear, Debian systemd-networkd introduction, <a rel="nofollow" href="https://medium.com/100-days-of-linux/working-with-systemd-networkd-e461cfe80e6d">Working with systemd-networkd.</a> The <a rel="nofollow" href="https://wiki.debian.org/SystemdNetworkd">systemd-networkd wiki page</a> and the <a rel="nofollow" href="https://manpages.debian.org/buster/systemd/systemd.network.5.en.html">systemd.network manpage</a> also are available.</p>

<ul>
<li><strong>Official Debian Network Setup Instructions</strong></li>
</ul>

<p>Official Debian network setup instructions include the <a rel="nofollow" href="https://wiki.debian.org/NetworkConfiguration">Wiki,</a> the <a rel="nofollow" href="https://www.debian.org/doc/manuals/debian-reference/ch05.en.html">Handbook,</a> manual pages such as <code>man interfaces</code>, /etc/network/interfaces examples <a rel="nofollow" href="https://salsa.debian.org/debian/ifupdown/-/blob/master/examples/network-interfaces">online,</a> and sometimes locally:</p>

<pre><code># less /usr/share/doc/ifupdown/examples/network-interfaces
</code></pre>

<ul>
<li><strong>The <code>ip</code> Command Usually Is Available Even Though Networking Setup Varies Among Linux Distributions</strong></li>
</ul>

<p>Setting up networking, DNS name resolution, and software package management is very different in different Linux distributions. Therefore, we should not assume that the steps taken below would be exactly the same with a different Linux distribution than Debian.</p>

<p>Nevertheless, despite the different distributions' differing network setup systems, the <code>ip</code> command, <a rel="nofollow" href="https://en.wikipedia.org/wiki/Iproute2">supplied by the iproute2 collection,</a> usually is available these days. Please see also Red Hat's <a rel="nofollow" href="https://access.redhat.com/sites/default/files/attachments/rh_ip_command_cheatsheet_1214_jcs_print.pdf">IP Command Cheat Sheet</a></p>

<p>Because the <code>ip</code> command often is available, networking can be configured in many distributions, including Debian, by running a sequence of <code>ip</code> commands. The net effect <img src="https://lowendspirit.com/plugins/emojiextender/emoji/twitter/smile.png" title=":)" alt=":)" height="18" /> of the sequence of <code>ip</code> commands can be to get the network functioning on most distributions without touching that individual distribution's network setup scheme.</p>

<p>Here's <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/63067/#Comment_63067">an example</a> of the <code>ip</code> command used in the context of an <a rel="nofollow" href="https://en.wikipedia.org/wiki/IPXE">iPXE boot.</a> Note that the first command in the linked example requires knowledge of the name of the interface. We can list the names of the interfaces on our system by running the <code>ip link show</code> command.</p>

<p>One issue with using a sequence of <code>ip</code> commands is that the network setup fails to persist across reboots. However, we can place the <code>ip</code> command sequence inside a script which will be run automagically every time the server reboots. The sequence of <code>ip</code> commands in a script reminds us of the days before systemd, when scripts controlled all parts of the boot process including network setup.</p>

<p>Our KVM VPS's internal network configuration that we will be using below is similar to <a rel="nofollow" href="https://lowendspirit.com/creating-our-first-lxc-vps-with-proxmox-ve-6-2-at-soyoustart/">how LXC containers are configured in Proxmox.</a> As will be seen below, Proxmox's LXC containers' network configuration adopts a variant of the "scripted <code>ip</code> command" approach, which also works inside Proxmox's KVM VPSes.</p>

<h2>V. Our VM's Network Setup</h2>

<ul>
<li><strong>Interfaces</strong></li>
</ul>

<p>Our original /etc/network/interfaces file, the one installed by the netinst.iso, might look like this:</p>

<pre><code>debian@debian-kvm:~$ cd /etc/network
debian@debian-kvm:/etc/network$ cat interfaces.original
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback
debian@debian-kvm:/etc/network$ 
</code></pre>

<p>Note that, in the default from the netinst.iso, /etc/network/interfaces.d is empty, so sourcing its files does nothing to the configuration.</p>

<pre><code>debian@debian-kvm:/etc/network$ ls interfaces.d
debian@debian-kvm:/etc/network$ 
</code></pre>

<p>Now, let's edit /etc/network/interfaces to match our example network information from the above Before We Start section.</p>

<pre><code>debian@debian-kvm:/etc/network$ cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
  address 172.16.165.97/28
  gateway 172.16.164.1

iface ens18 inet6 static
  address fe80:xxxx:xxxx:xxxx::97/128
  gateway fe80:xxxx:xxxx:xxxx::3

debian@debian-kvm:/etc/network$ 
</code></pre>

<p>The minimum required information does not include comments (lines beginning with <code>#</code>). Maybe we can make the rash and short-sighted assumption that we are not going to install anything which will want a file included from interfaces.d. The loopback interface might no longer be required <a rel="nofollow" href="https://salsa.debian.org/debian/ifupdown/-/blob/master/examples/network-interfaces">(please see lines 17 and 18 in this file from Debian sources).</a> Thus, for our example setup, the minimum /etc/network/interfaces might be:</p>

<pre><code>debian@debian-kvm:/etc/network$ cat interfaces

auto ens18
iface ens18 inet static
  address 172.16.165.97/28
  gateway 172.16.164.1

iface ens18 inet6 static
  address fe80:xxxx:xxxx:xxxx::97/128
  gateway fe80:xxxx:xxxx:xxxx::3

debian@debian-kvm:/etc/network$ 
</code></pre>

<p>When configuring Debian LXC containers, Proxmox configures their /etc/network/interfaces files using added post-up and pre-down routes. Similarly, just for fun, instead of giving the gateway addresses in our /etc/network/interfaces,, we can manually add routes. Except for the initial <code>post-up</code> and <code>pre-down</code> these added lines mirror <a rel="nofollow" href="https://talk.lowendspirit.com/discussion/comment/63067/#Comment_63067"><code>ip route</code> commands that we could run manually</a> to set up or take down networking without touching the /etc/network/interfaces file.</p>

<pre><code>debian@debian-kvm:/etc/network$ cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto ens18
iface ens18 inet static
  address 172.16.165.97/28
     post-up ip route add 172.16.164.1 dev ens18
     post-up ip route add default via 172.16.164.1 dev ens18
     pre-down ip route del default via 172.16.164.1 dev ens18
     pre-down ip route del 172.16.164.1 dev ens18

iface ens18 inet6 static
  address fe80:xxxx:xxxx:xxxx::97/128
     post-up ip route add fe80:xxxx:xxxx:xxxx::3  dev ens18
     post-up ip route add default via fe80:xxxx:xxxx:xxxx::3  dev ens18
     pre-down ip route del default via fe80:xxxx:xxxx:xxxx::3  dev ens18
     pre-down ip route del fe80:xxxx:xxxx:xxxx::3  dev ens18

debian@debian-kvm:/etc/network$ 
</code></pre>

<h2>VI. Our VM's DNS</h2>

<p>We might want to add more or different nameservers to /etc/resolv.conf. Our Quick Setup configuration, above, includes <a rel="nofollow" href="https://blog.cloudflare.com/dns-resolver-1-1-1-1/">IPs from Cloudflare</a> and <a rel="nofollow" href="https://developers.google.com/speed/public-dns">from Google.</a></p>

<h2>VII. Our VM's Apt Setup</h2>

<p>The Debian wiki instructions for configuring apt are at <a rel="nofollow" href="https://wiki.debian.org/SourcesList">https://wiki.debian.org/SourcesList.</a> There also is a <a rel="nofollow" href="https://manpages.debian.org/buster/apt/sources.list.5.en.html">man page.</a> The configuration shown above, in Section III Quick Setup, is from the <a rel="nofollow" href="https://wiki.debian.org/SourcesList">SourcesList Debian wiki page.</a></p>

<p>The Debian <a rel="nofollow" href="https://www.debian.org/security/">Security Information page</a> says:</p>

<blockquote><div>
  <p>You can use apt to easily get the latest security updates. This requires a line such as<br />
  deb <a href="http://security.debian.org/debian-security" rel="nofollow">http://security.debian.org/debian-security</a> buster/updates main contrib non-free</p>
</div></blockquote>

<p>Many of the larger providers offer Debian mirrors. For example, Debian packages and security updates are available from the <a rel="nofollow" href="https://docs.hetzner.com/robot/dedicated-server/operating-systems/hetzner-aptitude-mirror/">Hetzner Debian Mirror</a></p>

<p>After /etc/sources.list is edited, we update our system's package repositories as follows:</p>

<pre><code>apt-get upgrade &amp;&amp; apt-get dist-upgrade -y
</code></pre>

<p>We can see exactly which packages are installed by looking at the logs in /var/log/apt.</p>

<p>We may wish to install openssh-server so that we can connect to our VM via ssh in addition to our Proxmox VNC connection. With ssh we regain cut and paste functionality while enjoying lower apparent latency!</p>

<pre><code>apt-get install openssh-server
</code></pre>

<p>The <a rel="nofollow" href="https://aboutbryan.com/2013/03/03/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers/">Kennedy article,</a> mentioned below in Section VII, has some good tips for ssh server configuration.</p>

<h2>VIII. Security</h2>

<p><a rel="nofollow" href="https://www.google.com">Google</a> suggests its <a rel="nofollow" href="https://aboutbryan.com/2013/03/03/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers/">first choice among essential server security articles.</a> This article from 2013, by Bryan Kennedy, seems to provide still-good advice, except that, nowadays, many people prefer to use <a rel="nofollow" href="https://en.wikipedia.org/wiki/EdDSA">ed25519 keys</a></p>

<h2>IX. Backup</h2>

<p>After all this work, we certainly want to make an offline backup of our new VM. We can <a rel="nofollow" href="https://pve.proxmox.com/wiki/Backup_and_Restore">use Proxmox to make the backup</a> and then download a a copy from the host node's /var/lib/vz/dump directory.</p>
]]>
        </description>
    </item>
    <item>
        <title>How to Create and Setup a Debian KVM VPS with Proxmox VE 6 — Part II — Debian Install</title>
        <link>https://lowendspirit.com/index.php?p=/discussion/3917/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-ii-debian-install</link>
        <pubDate>Mon, 21 Mar 2022 19:40:48 +0000</pubDate>
        <category>LES Talk</category>
        <dc:creator>Not_Oles</dc:creator>
        <guid isPermaLink="false">3917@/index.php?p=/discussions</guid>
        <description><![CDATA[<p><em>Written by <a href="https://lowendspirit.com/index.php?p=/profile/Not_Oles" rel="nofollow">@Not_Oles</a>, 21 Apr 2021</em><br />
<small>Article was migrated from WordPress to Vanilla in March 2022</small></p>

<p>
  <img src="https://talk.lowendspirit.com/uploads/editor/n9/cixat1djj0ag.png" alt="image" />
</p>

<p><strong>Introduction</strong></p>

<p>In <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-i-creation">Part I of this series</a>, we downloaded the <a rel="nofollow" href="https://www.debian.org/CD/netinst/">Debian netinst install iso</a>. We then created a KVM VPS with the iso attached, and, finally, we successfully booted the iso.</p>

<p>In today's post, we're going to install our KVM with Debian 10 from the newly booted iso. But first, a bit of context on installing.</p>

<p><strong>Context</strong></p>

<ul>
<li><strong>Why the Debian minimal netinst iso?</strong></li>
</ul>

<p>Debian themselves say, <a rel="nofollow" href="https://www.debian.org/CD/netinst/">"we think that in many cases the minimal CD image is better — above all, you only download the packages that you selected for installation on your machine. . . ."</a></p>

<p>What we gain from this series is a well-proven, widely used, minimal, highly extensible, open-source server operating system.</p>

<ul>
<li><strong>What about networking?</strong></li>
</ul>

<p>The biggest difference between installing on our VPS and installing on our personal laptop or desktop might be network configuration. On personal devices, we are used to automatic network configuration happening behind the scenes via <a rel="nofollow" href="https://en.wikipedia.org/wiki/Dynamic_Host_Configuration_Protocol">Dynamic Host Configuration Protocol (DHCP)</a>. We turn on our device, it gets its own IP address and internet connection without our having to do much.</p>

<p>On servers, however, the server's IP address and internet connection sometimes are set by hand instead of automatically via DHCP. Traditionally, server network settings are done from a console physically connected to the running server. Obviously, however, if our server is at a remote location, we cannot have a wired connection. Also, since networking hasn't yet been set up inside the server, we can't connect directly to our remote server over the internet, either.</p>

<p>As might be expected, the Debian minimal netinst iso is set up to configure networking automatically via DHCP. Thus, when we try the networking step of the install, that step will fail. The netinst iso will succeed, however, in installing a minimal Debian system without networking. In Part III of this series, covering Post Install Configuration, we will use the Proxmox web GUI and VNC to go inside our minimal system and set up networking by hand.</p>

<ul>
<li><strong>Alternative installation methods</strong></li>
</ul>

<p>It might be worth mentioning a few of the many other excellent methods of server installation which, although frequently used, are not selected here because they might be even more complex than our "simple" <img src="images/smile.png" alt=":)" title=":)" /> method.</p>

<ul>
<li>First, <a rel="nofollow" href="https://lowendspirit.com/debian-unattended-installation-using-a-preseed-file">Debian unattended Installation using a preseed file</a> will not work here because no networking is set up to use for obtaining the preseed file.</li>
<li>Cloud-init is <a rel="nofollow" href="https://github.com/canonical/cloud-init">"the <em>industry standard</em> multi-distribution method for cross-platform cloud instance initialization."</a> However, the <a rel="nofollow" href="https://pve.proxmox.com/wiki/Cloud-Init_Support">Proxmox Cloud-Init Support wiki article</a> says, despite the convenience of ready-made images, "we usually recommended to prepare the images by yourself," because "you will know exactly what you have installed." Also, for a special perspective on Cloud-Init, you might enjoy watching <a rel="nofollow" href="https://www.hashicorp.com/resources/cloudinit-the-good-parts">Cloud-Init: The Good Parts.</a></li>
<li>Proxmox supports <a rel="nofollow" href="https://pve.proxmox.com/wiki/VM_Templates_and_Clones">Templates.</a> It's possible to create templates with <a rel="nofollow" href="https://www.packer.io/">Packer.</a> If interested, you can check <a rel="nofollow" href="https://dev.to/aaronktberry/creating-proxmox-templates-with-packer-1b35">Creating proxmox templates with packer.</a></li>
</ul>

<p><strong>Before We Start</strong></p>

<p>We need to begin today at <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-i-creation">the exact stage where we left Part I.</a> Our Debian Installer should be booted and running on our VPS.</p>

<p>We also will need the server's hostname (which can be Debian) plus the username (which also can be Debian) and the real name for the user account which the installer will create. It's also convenient to have on hand two <a rel="nofollow" href="https://passwords-generator.org/">previously generated good passwords,</a> one for the root account and another for the new user account.</p>

<p><strong>Debian Installer Steps</strong></p>

<ul>
<li><strong>Select Install</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/h2/9s2boinm789t.png" alt="" title="" /></p>

<ul>
<li><strong>Language</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/oi/jyzq11ay2z2c.png" alt="" title="" /></p>

<ul>
<li><strong>Location</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/d8/4ogce6eln8c9.png" alt="" title="" /></p>

<ul>
<li><strong>Keyboard</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/10/ws7jw1dfl4uk.png" alt="" title="" /></p>

<ul>
<li><strong>DHCP Tries and Fails</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/00/qbxl1icecoc6.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/dz/csnojjtvtggb.png" alt="" title="" /></p>

<ul>
<li><strong>Select "Do Not Configure Network at this Time"</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/9e/73uzhwy2lvp4.png" alt="" title="" /></p>

<ul>
<li><strong>Hostname</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/il/445y6j7140ya.png" alt="" title="" /></p>

<ul>
<li><strong>Enter and Confirm the Root Password</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/7n/9pzj9y6y9qtf.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ya/jymedyyrhi6x.png" alt="" title="" /></p>

<ul>
<li><strong>User's Real Name</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/o5/bbaqkg91187q.png" alt="" title="" /></p>

<ul>
<li><strong>Username</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/p7/a0ccap5kqxff.png" alt="" title="" /></p>

<ul>
<li><strong>User Password</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/40/9mkk3s6d1qzk.png" alt="" title="" /></p>

<p><img src="https://talk.lowendspirit.com/uploads/editor/od/sh8bx3s7ht09.png" alt="" title="" /></p>

<ul>
<li><strong>Time Zone</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/tq/1qgateac02jk.png" alt="" title="" /></p>

<ul>
<li><strong>Partitioning Method</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/3h/gxc2wxgj9mfk.png" alt="" title="" /></p>

<ul>
<li><strong>Disk to Partition</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/os/uvqci3hbc4vy.png" alt="" title="" /></p>

<ul>
<li><strong>Partitioning Scheme</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/pl/31wn8e92ka2o.png" alt="" title="" /></p>

<ul>
<li><strong>Confirm Partitioning</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/9l/hh5ah0wha62m.png" alt="" title="" /></p>

<ul>
<li><strong>Write Changes to Disks</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/io/55x6c3zhihri.png" alt="" title="" /></p>

<ul>
<li><strong>Confirm No Additional Install Media</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/n4/b8zo11jrg9vz.png" alt="" title="" /></p>

<ul>
<li><strong>Confirm No Network Mirror</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/tj/riw8uqbklrhr.png" alt="" title="" /></p>

<ul>
<li><strong>Package Usage Survey</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/nl/brp3sp93qayg.png" alt="" title="" /></p>

<ul>
<li><strong>Choose Additional Software</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/8p/vtuzuhlsub2p.png" alt="" title="" /></p>

<ul>
<li><strong>Dual Boot</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/ad/vzsroraic1ds.png" alt="" title="" /></p>

<ul>
<li><strong>Grub</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/rf/a825mn0s7p30.png" alt="" title="" /></p>

<ul>
<li><strong>Installation Complete</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/3g/q96cfykeh2zm.png" alt="" title="" /></p>

<p>In the Proxmox web GUI, we select VPS &gt; Hardware &gt; CD/DVD Drive. Press edit and select "Do not use any media." Then, we return to our "Installation Complete" screen by selecting Console, which should reappear just as we left it. Finally, we click the "Continue" button, which should reboot the VPS.</p>

<p>In <a rel="nofollow" href="https://lowendspirit.com/how-to-create-and-setup-a-debian-kvm-vps-with-proxmox-ve-6-part-i-creation">Part I</a>, we did not install Qemu Agent. Therefore, rebooting from the Proxmox web GUI (outside our VPS) as opposed to rebooting from the console (inside our VPS) might not work. However, if it is necessary to stop the server from the web GUI, we can use the web GUI's Stop command found on the drop-down menu of the Shutdown button.</p>

<ul>
<li><strong>Successful Reboot</strong></li>
</ul>

<p><img src="https://talk.lowendspirit.com/uploads/editor/yi/5qiz1u3nginb.png" alt="" title="" /></p>
]]>
        </description>
    </item>
   </channel>
</rss>
