<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>kvm Archives - Linux Windows and android Tutorials</title>
	<atom:link href="https://www.osradar.com/tag/kvm/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.osradar.com</link>
	<description>tutorials and news and Seurity</description>
	<lastBuildDate>Wed, 18 Nov 2020 17:47:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.8.13</generator>
	<item>
		<title>How to create a new KVM virtual Machine on Debian 10 / Ubuntu 20.04?</title>
		<link>https://www.osradar.com/create-a-new-kvm-virtual-machine-debian/</link>
					<comments>https://www.osradar.com/create-a-new-kvm-virtual-machine-debian/#respond</comments>
		
		<dc:creator><![CDATA[angeloma]]></dc:creator>
		<pubDate>Thu, 19 Nov 2020 02:44:00 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Servers]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[kvm]]></category>
		<category><![CDATA[virtual machine]]></category>
		<guid isPermaLink="false">https://www.osradar.com/?p=22291</guid>

					<description><![CDATA[<p>In the previous post, we explained How to install KVM on Debian 10 / Ubuntu 20.04. Now it&#8217;s time to create a KVM Virtual Machine. Creating a new KVM Virtual Machine on Debian 10 / Ubuntu 20.04 Creating a network bridge Before creating a virtual machine, the following must be taken into account. A new [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/create-a-new-kvm-virtual-machine-debian/">How to create a new KVM virtual Machine on Debian 10 / Ubuntu 20.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In the previous post, we explained <a href="https://www.osradar.com/install-kvm-debian-ubuntu/" target="_blank" rel="noreferrer noopener">How to install KVM on Debian 10 / Ubuntu 20.04</a>. Now it&#8217;s time to create a KVM Virtual Machine.</p>



<h2>Creating a new KVM Virtual Machine on Debian 10 / Ubuntu 20.04</h2>



<h3>Creating a network bridge</h3>



<p>Before creating a virtual machine, the following must be taken into account. A new network interface is created when installing KVMs. If you are going to test some systems this is enough, but if you want the virtual machine to be accessible from the whole network then you have to create a Bridge.</p>



<p>To do this, edit the interfaces file:</p>



<pre class="wp-block-preformatted">:~$ sudo nano /etc/network/interfaces</pre>



<p>And add the following:</p>



<pre class="wp-block-preformatted">auto ens33
iface ens33 inet manual

auto br0
iface br0 inet static
address x.x.x.x
netmask x.x.x.x
network x.x.x.x
broadcast x.x.x.x
gateway x.x.x.x
bridge_ports ens33
bridge_stp off
bridge_fd 0
bridge_maxwait 0
dns-nameservers x.x.x.x</pre>



<p>In my case, the physical network interface is ens33. Remember you can find out your network interface by typing:</p>



<pre class="wp-block-preformatted">:~$ ip addr</pre>



<p>And the network parameters depend on each case. And you have to replace them with your own.</p>



<p>Save the changes, exit the editor, and reboot your computer.</p>



<p>In case you are doing this tutorial on a Debian 10 / Ubuntu 20.04 system that has a desktop environment installed, you can do it through the Network options. There the process is more intuitive and easier to do on <a aria-label="undefined (opens in a new tab)" rel="noreferrer noopener" href="https://www.osradar.com/gnome-os-is-here/" target="_blank">GNOME</a>, KDE, or Cinnamon.</p>



<p><strong>Remember that this step is optional.</strong></p>



<h3>Creating the KVM Virtual Machine using Virt-Manager</h3>



<p>Virt-Manager is a program that allows us from a graphic interface to create a KVM Virtual Machine. If you are using Debian with a desktop environment then this section of the tutorial is for you.</p>



<p>So, install it with the following command</p>



<pre class="wp-block-preformatted">:~$ sudo apt install virt-manager
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
gir1.2-gtk-vnc-2.0 gir1.2-libvirt-glib-1.0 gir1.2-spiceclientglib-2.0
gir1.2-spiceclientgtk-3.0 python-asn1crypto python-certifi
python-cffi-backend python-chardet python-cryptography python-enum34
python-idna python-ipaddress python-openssl python-requests python-urllib3
Suggested packages:
python-cryptography-doc python-cryptography-vectors python-enum34-doc
python-openssl-doc python-openssl-dbg python-socks python-ntlm
python3-guestfs
The following NEW packages will be installed:
gir1.2-gtk-vnc-2.0 gir1.2-libvirt-glib-1.0 gir1.2-spiceclientglib-2.0
gir1.2-spiceclientgtk-3.0 python-asn1crypto python-certifi
python-cffi-backend python-chardet python-cryptography python-enum34
python-idna python-ipaddress python-openssl python-requests python-urllib3
virt-manager
0 upgraded, 16 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,400 kB of archives.
After this operation, 12.1 MB of additional disk space will be used.
Do you want to continue? [Y/n]</pre>



<figure class="wp-block-image size-large"><img loading="lazy" width="1024" height="576" src="https://www.osradar.com/wp-content/uploads/2020/08/1-8-1024x576.png" alt="1.- Installing Virt-manager on Debian 10 / Ubuntu 20.04" class="wp-image-22531" srcset="https://www.osradar.com/wp-content/uploads/2020/08/1-8-1024x576.png 1024w, https://www.osradar.com/wp-content/uploads/2020/08/1-8-300x169.png 300w, https://www.osradar.com/wp-content/uploads/2020/08/1-8-768x432.png 768w, https://www.osradar.com/wp-content/uploads/2020/08/1-8-696x391.png 696w, https://www.osradar.com/wp-content/uploads/2020/08/1-8-1068x600.png 1068w, https://www.osradar.com/wp-content/uploads/2020/08/1-8.png 1366w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>1.- Installing Virt-manager on Debian 10 / Ubuntu 20.04</figcaption></figure>



<p>It will then be available from the main menu. When you start it, you will be asked for the root password.</p>



<p>And you will see the main screen:</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="550" height="550" src="https://www.osradar.com/wp-content/uploads/2020/08/2-4.png" alt="2.- Virt-manager main screen" class="wp-image-22532" srcset="https://www.osradar.com/wp-content/uploads/2020/08/2-4.png 550w, https://www.osradar.com/wp-content/uploads/2020/08/2-4-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2020/08/2-4-150x150.png 150w" sizes="(max-width: 550px) 100vw, 550px" /><figcaption>2.- Virt-manager main screen</figcaption></figure>



<p>Press the button to create a new virtual machine.</p>



<p>Then, select how you want to get the image of the virtual machine. It can be local or remote. In my case, I will choose local because I already downloaded it.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="500" height="500" src="https://www.osradar.com/wp-content/uploads/2020/08/3-3.png" alt="3.- Creating a new KVM Virtual Machine" class="wp-image-22533" srcset="https://www.osradar.com/wp-content/uploads/2020/08/3-3.png 500w, https://www.osradar.com/wp-content/uploads/2020/08/3-3-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2020/08/3-3-150x150.png 150w" sizes="(max-width: 500px) 100vw, 500px" /><figcaption>3.- Creating a new KVM Virtual Machine</figcaption></figure>



<p>Clicking the <em>Browser</em> button and then the <em>Browse Local</em> button you can choose the system image from your computer.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="500" height="500" src="https://www.osradar.com/wp-content/uploads/2020/08/4-3.png" alt="4.- Select the OS image" class="wp-image-22534" srcset="https://www.osradar.com/wp-content/uploads/2020/08/4-3.png 500w, https://www.osradar.com/wp-content/uploads/2020/08/4-3-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2020/08/4-3-150x150.png 150w" sizes="(max-width: 500px) 100vw, 500px" /><figcaption>4.- Select the OS image</figcaption></figure>



<p>Then set how much RAM and CPU memory the new virtual machine will use.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="500" height="500" src="https://www.osradar.com/wp-content/uploads/2020/08/5-1.png" alt="5.- KVM Virtual Machine settings" class="wp-image-22535" srcset="https://www.osradar.com/wp-content/uploads/2020/08/5-1.png 500w, https://www.osradar.com/wp-content/uploads/2020/08/5-1-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2020/08/5-1-150x150.png 150w" sizes="(max-width: 500px) 100vw, 500px" /><figcaption>5.- KVM Virtual Machine settings</figcaption></figure>



<p>On the next screen, set the storage disk of the virtual machine. In this section you can set the size or disable the storage. Useful for LIVE images of distributions.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="500" height="500" src="https://www.osradar.com/wp-content/uploads/2020/08/6-1.png" alt="6.- Disks options" class="wp-image-22536" srcset="https://www.osradar.com/wp-content/uploads/2020/08/6-1.png 500w, https://www.osradar.com/wp-content/uploads/2020/08/6-1-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2020/08/6-1-150x150.png 150w" sizes="(max-width: 500px) 100vw, 500px" /><figcaption>6.- Disks options</figcaption></figure>



<p>Then you will see the virtual machine summary and on this screen, you can choose the network to use.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="500" height="500" src="https://www.osradar.com/wp-content/uploads/2020/08/7-1.png" alt="7.- Creating a new KVM virtual machine on Debian 10 / Ubuntu 20.04" class="wp-image-22538" srcset="https://www.osradar.com/wp-content/uploads/2020/08/7-1.png 500w, https://www.osradar.com/wp-content/uploads/2020/08/7-1-300x300.png 300w, https://www.osradar.com/wp-content/uploads/2020/08/7-1-150x150.png 150w" sizes="(max-width: 500px) 100vw, 500px" /><figcaption>7.- Creating a new KVM virtual machine on Debian 10 / Ubuntu 20.04</figcaption></figure>



<p>And that&#8217;s it, the virtual machine will start.</p>



<figure class="wp-block-image size-large"><img loading="lazy" width="800" height="600" src="https://www.osradar.com/wp-content/uploads/2020/08/8-1.png" alt="8.- A KVM Virtual Machine running" class="wp-image-22540" srcset="https://www.osradar.com/wp-content/uploads/2020/08/8-1.png 800w, https://www.osradar.com/wp-content/uploads/2020/08/8-1-300x225.png 300w, https://www.osradar.com/wp-content/uploads/2020/08/8-1-768x576.png 768w, https://www.osradar.com/wp-content/uploads/2020/08/8-1-696x522.png 696w, https://www.osradar.com/wp-content/uploads/2020/08/8-1-80x60.png 80w, https://www.osradar.com/wp-content/uploads/2020/08/8-1-265x198.png 265w" sizes="(max-width: 800px) 100vw, 800px" /><figcaption>8.- A KVM Virtual Machine running</figcaption></figure>



<h3>Creating the KVM Virtual Machine from the terminal</h3>



<p>Sure, the above step works if there is a desktop environment installed, but what if not? Well, you can also create it using the terminal.</p>



<p>To do this, you should create a folder where the files of this virtual machine will be. Inside this folder, you can create two more, one for the image and another for the storage.</p>



<pre class="wp-block-preformatted">:~$ mkdir -p virtual/{iso,storage}</pre>



<p>In that ISO folder should be the image of the operating system you want to install in the virtual machine. Remember that using <a href="https://www.osradar.com/the-wget-command/" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">the wget command</a> you can get one.</p>



<p>And now the command that creates the virtual machine is this:</p>



<pre class="wp-block-preformatted">:~$ sudo virt-install --name [name] --os-type linux --os-variant [linux-distribution] --ram [size] --vcpu [number] --disk path=[path]/[name].qcow2,size=10 --graphics vnc,listen=0.0.0.0 --noautoconsole --hvm --cdrom [path] --boot cdrom,hd</pre>



<p>Remember to change the values in [] to the ones that are right for you.</p>



<p>If there is no error in the screen output, it means that the machine has been successfully created.</p>



<p>To access it, use a VNC client and use your IP address and port 0.</p>



<h2>Conclusion</h2>



<p>KVM is a wonderful technology that allows you to create virtual machines quickly. Whether using a graphical interface or the terminal the result is the same.</p>



<p>So, share this post and join <a href="https://t.me/osradar" target="_blank" aria-label="undefined (opens in a new tab)" rel="noreferrer noopener">our Telegram Channel</a>.</p>
<p>The post <a rel="nofollow" href="https://www.osradar.com/create-a-new-kvm-virtual-machine-debian/">How to create a new KVM virtual Machine on Debian 10 / Ubuntu 20.04?</a> appeared first on <a rel="nofollow" href="https://www.osradar.com">Linux  Windows and android  Tutorials</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.osradar.com/create-a-new-kvm-virtual-machine-debian/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
