Create an account


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Fedora - Create virtual machines with Cockpit in Fedora

#1
Create virtual machines with Cockpit in Fedora

<div><p>This article shows you how to install the software you need to use Cockpit to create and manage virtual machines on Fedora 31. Cockpit is <a href="https://cockpit-project.org/">an interactive admin interface</a> that lets you access and manage systems from any supported web browser. With <a href="https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/8.0_release_notes/rhel-8_0_0_release#virtualization_4">virt-manager being deprecated</a> users are encouraged to use Cockpit instead, which is meant to replace it.</p>
<p> <span id="more-29555"></span> </p>
<p>Cockpit is an actively developed project, with many plugins available that extend how it works. For example, one such plugin is “Machines,” which interacts with libvirtd and lets users create and manage virtual machines.</p>
<h2>Installing software</h2>
<p>The required software prerequisites are <em>libvirt</em>, <em>cockpit</em> and <em>cockpit-machines</em>. To install them on Fedora 31, run the following command from a terminal <a href="https://fedoramagazine.org/howto-use-sudo/">using sudo</a>:</p>
<pre class="wp-block-preformatted">$ sudo dnf install libvirt cockpit cockpit-machines</pre>
<p>Cockpit is also included as part of the “Headless Management” package group. This group is useful for a Fedora based server that you only access through a network. In that case, to install it, use this command:</p>
<pre class="wp-block-preformatted">$ sudo dnf groupinstall "Headless Management"</pre>
<h2>Setting up Cockpit services</h2>
<p>After installing the necessary packages it’s time to enable the services. The <em>libvirtd</em> service runs the virtual machines, while Cockpit has a socket activated service to let you access the Web GUI:</p>
<pre class="wp-block-preformatted">$ sudo systemctl enable libvirtd --now
$ sudo systemctl enable cockpit.socket --now</pre>
<p>This should be enough to run virtual machines and manage them through Cockpit. Optionally, if you want to access and manage your machine from another device on your network, you need to expose the service to the network. To do this, add a new rule in your firewall configuration:</p>
<pre class="wp-block-preformatted">$ sudo firewall-cmd --zone=public --add-service=cockpit --permanent
$ sudo firewall-cmd --reload</pre>
<p>To confirm the services are running and no issues occurred, check the status of the services:</p>
<pre class="wp-block-preformatted">$ sudo systemctl status libvirtd
$ sudo systemctl status cockpit.socket</pre>
<p>At this point everything should be working. The Cockpit web GUI should be available at <a href="https://localhost:9090">https://localhost:9090</a> or <a href="https://127.0.0.1:9090">https://127.0.0.1:9090</a>. Or, enter the local network IP in a web browser on any other device connected to the same network. (Without SSL certificates setup, you may need to allow a connection from your browser.)</p>
<h2>Creating and installing a machine</h2>
<p>Log into the interface using the user name and password for that system. You can also choose whether to allow your password to be used for administrative tasks in this session.</p>
<p>Select <em>Virtual Machines</em> and then select <em>Create VM</em> to build a new box. The console gives you several options:</p>
<ul>
<li>Download an OS using Cockpit’s built in library</li>
<li>Use install media already downloaded on the system you’re managing</li>
<li>Point to a URL for an OS installation tree</li>
<li>Boot media over the network via the <a href="https://en.wikipedia.org/wiki/Preboot_Execution_Environment">PXE</a> protocol</li>
</ul>
<p>Enter all the necessary parameters. Then select <em>Create</em> to power up the new virtual machine.</p>
<p>At this point, a graphical console appears. Most modern web browsers let you use your keyboard and mouse to interact with the VM console. Now you can complete your installation and use your new VM, just as you would <a href="https://fedoramagazine.org/full-virtualization-system-on-fedora-workstation-30/">via virt-manager in the past</a>.</p>
<hr class="wp-block-separator" />
<p><em>Photo by <a href="https://flickr.com/photos/miguelteixeira/">Miguel Teixeira</a> on <a href="https://flickr.com/photos/miguelteixeira/2964851828/">Flickr</a> (CC BY-SA 2.0).</em></p>
</div>


https://www.sickgaming.net/blog/2019/11/...in-fedora/
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum software by © MyBB Theme © iAndrew 2016