Files
oneclickvirt.github.io/assets/en_incomplete_webvirtcloud.md.CcbzCTXX.js
2025-05-26 11:24:59 +00:00

46 lines
48 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{_ as i,c as a,o as t,ag as e}from"./chunks/framework.CSeR4K32.js";const n="/assets/wv1.8ARiSJ9x.png",g=JSON.parse('{"title":"WebVirtCloud Installation Guide","description":"","frontmatter":{"outline":"deep"},"headers":[],"relativePath":"en/incomplete/webvirtcloud.md","filePath":"en/incomplete/webvirtcloud.md","lastUpdated":1748258671000}'),l={name:"en/incomplete/webvirtcloud.md"};function p(h,s,r,o,k,d){return t(),a("div",null,s[0]||(s[0]=[e(`<h1 id="webvirtcloud-installation-guide" tabindex="-1">WebVirtCloud Installation Guide <a class="header-anchor" href="#webvirtcloud-installation-guide" aria-label="Permalink to &quot;WebVirtCloud Installation Guide&quot;"></a></h1><p><a href="https://hits.spiritlhl.net" target="_blank" rel="noreferrer"><img src="https://hits.spiritlhl.net/webvirtcloud.svg?action=hit&amp;title=hits&amp;title_bg=%23555555&amp;count_bg=%233aebee&amp;edge_flat=false" alt="hits"></a></p><p>Repository: <a href="https://github.com/oneclickvirt/webvirtcloud" target="_blank" rel="noreferrer">https://github.com/oneclickvirt/webvirtcloud</a></p><p>Original project repository: <a href="https://github.com/webvirtcloud/webvirtcloud" target="_blank" rel="noreferrer">https://github.com/webvirtcloud/webvirtcloud</a></p><h2 id="_1-controller-installation" tabindex="-1">1. Controller Installation <a class="header-anchor" href="#_1-controller-installation" aria-label="Permalink to &quot;1. Controller Installation&quot;"></a></h2><h3 id="system-requirements" tabindex="-1">System Requirements <a class="header-anchor" href="#system-requirements" aria-label="Permalink to &quot;System Requirements&quot;"></a></h3><p><strong>Minimum Requirements:</strong></p><ul><li>CPU: 1 core</li><li>Memory: 1 GB RAM</li><li>Storage: 10 GB free space</li><li>System: Debian11+, Ubuntu20.04+, Centos8+, AlmaLinux8+, RockyLinux8+</li></ul><h3 id="default-login-information" tabindex="-1">Default Login Information <a class="header-anchor" href="#default-login-information" aria-label="Permalink to &quot;Default Login Information&quot;"></a></h3><ul><li>Username: <code>[email protected]</code></li><li>Password: <code>admin</code></li></ul><h3 id="panel-access" tabindex="-1">Panel Access <a class="header-anchor" href="#panel-access" aria-label="Permalink to &quot;Panel Access&quot;"></a></h3><ul><li>User Panel: <code>https://192-168-0-114.nip.io</code></li><li>Admin Backend: <code>https://192-168-0-114.nip.io/admin</code></li></ul><blockquote><p><strong>Note:</strong> Replace <code>192.168.0.114</code> with your public IP to get the actual accessible address.</p></blockquote><h3 id="installation-command" tabindex="-1">Installation Command <a class="header-anchor" href="#installation-command" aria-label="Permalink to &quot;Installation Command&quot;"></a></h3><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -slk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://raw.githubusercontent.com/oneclickvirt/webvirtcloud/main/scripts/install_webvirt_cloud.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install_webvirt_cloud.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">chmod</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> +x</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install_webvirt_cloud.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bash</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install_webvirt_cloud.sh</span></span></code></pre></div><div class="tip custom-block"><p class="custom-block-title">TIP</p><p>The execution process may be stuck in the clone repository has not been moving, at this time, press ctrl + c to exit the implementation, re-execution of the installation script on the line, the Department of Docker installation is stuck in the stage of the build project.</p></div><h2 id="_2-compute-node-installation" tabindex="-1">2. Compute Node Installation <a class="header-anchor" href="#_2-compute-node-installation" aria-label="Permalink to &quot;2. Compute Node Installation&quot;"></a></h2><blockquote><p><strong>Important:</strong> Hypervisor and Controller cannot be installed on the same virtual machine, otherwise network conflicts will occur.</p></blockquote><h3 id="system-requirements-1" tabindex="-1">System Requirements <a class="header-anchor" href="#system-requirements-1" aria-label="Permalink to &quot;System Requirements&quot;"></a></h3><p><strong>Recommended Configuration:</strong></p><ul><li>CPU: 2 cores</li><li>Memory: 4 GB RAM</li><li>Storage: 40 GB free space</li><li>System: AlmaLinux8+, RockyLinux8+</li></ul><blockquote><p><strong>Additional Notes:</strong></p><ul><li>Higher configurations are recommended for actual use; the test environment is only sufficient for running 4 minimal virtual machines.</li><li>Servers with KVM nested virtualization support are recommended. If <code>VM-x/AMD-V/Hyper-V</code> is not enabled, it will automatically switch to QEMU using TCG emulation to set up virtual machines, though performance will be reduced.</li><li>The installation skips environment checks and uses binary files directly, so no dependencies need to be installed.</li></ul></blockquote><h3 id="environment-check" tabindex="-1">Environment Check <a class="header-anchor" href="#environment-check" aria-label="Permalink to &quot;Environment Check&quot;"></a></h3><p>Check if the server supports KVM nested virtualization:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -L</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://cdn.spiritlhl.net/https://raw.githubusercontent.com/oneclickvirt/ecs/master/goecs.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> goecs.sh</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">chmod</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> +x</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> goecs.sh</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">./goecs.sh</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> &amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">goecs</span></span></code></pre></div><p>Select hardware individual test</p><h3 id="compute-node-installation-steps" tabindex="-1">Compute Node Installation Steps <a class="header-anchor" href="#compute-node-installation-steps" aria-label="Permalink to &quot;Compute Node Installation Steps&quot;"></a></h3><ol><li><p>Download the installation script:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">curl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -slk</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://raw.githubusercontent.com/oneclickvirt/webvirtcloud/main/scripts/install_hypervisor.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -o</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install_hypervisor.sh</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> \\</span></span>
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">&amp;&amp; </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">chmod</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> +x</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install_hypervisor.sh</span></span></code></pre></div></li><li><p>Execute installation (replace with your Controller IP):</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">bash</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> install_hypervisor.sh</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> x.x.x.x</span></span></code></pre></div><blockquote><p>Replace <code>x.x.x.x</code> with the actual IP address of your Controller.</p></blockquote></li><li><p>Node Management in Panel<br> After execution, there will be prompts for information needed in the Controller panel.<br> In the panel, the Hostname to be entered is the current compute node&#39;s IPv4 address, and you need to enter the Token to identify the node.</p></li></ol><h3 id="networkmanager-version-issue" tabindex="-1">NetworkManager Version Issue <a class="header-anchor" href="#networkmanager-version-issue" aria-label="Permalink to &quot;NetworkManager Version Issue&quot;"></a></h3><p>During installation, you may encounter the following error:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>Connection &#39;eth0&#39; (bed050e9-ff49-4665-8112-24ddf2a1cd3c) successfully deleted.</span></span>
<span class="line"><span>Warning: nmcli (1.48.10) and NetworkManager (1.42.2) versions don&#39;t match. Restarting NetworkManager is advised.</span></span>
<span class="line"><span>Error: Failed to add &#39;br-ext&#39; connection: connection.autoconnect-ports: unknown property</span></span></code></pre></div><p><strong>Solution:</strong> Restart the server and re-execute the installation command.</p><h3 id="installation-time-note" tabindex="-1">Installation Time Note <a class="header-anchor" href="#installation-time-note" aria-label="Permalink to &quot;Installation Time Note&quot;"></a></h3><ul><li>The entire process takes approximately <strong>10-25 minutes</strong>.</li><li>Most of the time is spent downloading <code>finnix-125.iso</code> to <code>/var/lib/libvirt/isos/finnix-125.iso</code>.</li><li>This part cannot be accelerated, so it&#39;s <strong>recommended to use tmux or screen</strong> to prevent interruption.</li></ul><h3 id="adding-compute-node-to-control-panel" tabindex="-1">Adding Compute Node to Control Panel <a class="header-anchor" href="#adding-compute-node-to-control-panel" aria-label="Permalink to &quot;Adding Compute Node to Control Panel&quot;"></a></h3><p>After installation, a <strong>Token</strong> will be generated for adding the compute node in the control panel (Admin panel):</p><p>Path: <code>Admin Panel &gt; Computers &gt; Add Computer</code></p><ul><li><code>HostName</code> should be filled with the compute node&#39;s public IPv4 address</li><li><code>Token</code> should be filled with the token key obtained on the compute node</li></ul><h2 id="_3-public-ipv4-port-mapping" tabindex="-1">3. Public IPv4 Port Mapping <a class="header-anchor" href="#_3-public-ipv4-port-mapping" aria-label="Permalink to &quot;3. Public IPv4 Port Mapping&quot;"></a></h2><h3 id="_3-1-automatic-mapping" tabindex="-1">3.1 Automatic Mapping <a class="header-anchor" href="#_3-1-automatic-mapping" aria-label="Permalink to &quot;3.1 Automatic Mapping&quot;"></a></h3><p>Automatic mapping features:</p><ul><li><strong>Automatic Monitoring</strong>: Real-time monitoring of virtual machine status changes, automatically applying or cleaning up port mapping rules</li><li><strong>Intelligent Port Allocation</strong>: Automatically calculating and allocating non-conflicting ports based on VM IP addresses</li><li><strong>Rule Persistence</strong>: Using firewall-cmd to ensure port mapping rules remain effective after host restart</li><li><strong>Mapping Records</strong>: Automatically maintaining mapping information records for easy viewing and management</li><li><strong>Conflict Prevention</strong>: Intelligently detecting and avoiding port conflicts, ensuring each VM has unique port mappings</li></ul><h4 id="installation-method" tabindex="-1">Installation Method <a class="header-anchor" href="#installation-method" aria-label="Permalink to &quot;Installation Method&quot;"></a></h4><ol><li><p>Download the script to a temporary directory:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">wget</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -O</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /tmp/vm_port_mapping_setup.sh</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> https://raw.githubusercontent.com/oneclickvirt/webvirtcloud/refs/heads/main/extra_scripts/vm_port_mapping_daemon.sh</span></span></code></pre></div></li><li><p>Add execution permission:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">chmod</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> +x</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /tmp/vm_port_mapping_setup.sh</span></span></code></pre></div></li><li><p>Run the installer:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">/tmp/vm_port_mapping_setup.sh</span></span></code></pre></div></li></ol><p>The script will automatically complete the following operations:</p><ul><li>Copy itself to the system directory <code>/usr/local/sbin/vm_port_mapping_daemon.sh</code></li><li>Create a systemd service unit file</li><li>Enable and start the service</li></ul><h4 id="port-mapping-rules" tabindex="-1">Port Mapping Rules <a class="header-anchor" href="#port-mapping-rules" aria-label="Permalink to &quot;Port Mapping Rules&quot;"></a></h4><p>The daemon will assign the following ports for each virtual machine:</p><ol><li><p><strong>SSH Port</strong>:</p><ul><li>Calculation formula: <code>(Last segment of IP) × 100 + 22 + 10000</code></li><li>Example: For IP address 192.168.33.114, the mapped SSH port is 114×100+22+10000 = 21422</li></ul></li><li><p><strong>Extra Ports</strong>:</p><ul><li>10 additional ports are allocated for each VM</li><li>Starting port: 20000 + (Last segment of IP) × 100</li><li>Ending port: Starting port + 9</li><li>Example: For IP address 192.168.33.114, extra port range is 20000+(114×100) to 20000+(114×100)+9</li></ul></li></ol><p>If the calculated port is already occupied, the program will automatically find the next available port to ensure no conflicts occur.</p><h4 id="mapping-file" tabindex="-1">Mapping File <a class="header-anchor" href="#mapping-file" aria-label="Permalink to &quot;Mapping File&quot;"></a></h4><p>All port mapping information is saved in the <code>/etc/vm_port_mapping/mapping.txt</code> file, in the format:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>VM name IP address MAC address SSH mapped port Extra ports start Extra ports end</span></span></code></pre></div><p>For example:</p><div class="language- vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang"></span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span>Virtance-1 192.168.33.114 52:54:00:5f:77:92 21422 31400 31409</span></span></code></pre></div><h4 id="service-management" tabindex="-1">Service Management <a class="header-anchor" href="#service-management" aria-label="Permalink to &quot;Service Management&quot;"></a></h4><ul><li><p><strong>Check service status</strong>:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> status</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span></code></pre></div></li><li><p><strong>Start service</strong>:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> start</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span></code></pre></div></li><li><p><strong>Stop service</strong>:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> stop</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span></code></pre></div></li><li><p><strong>Disable auto-start</strong>:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> disable</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span></code></pre></div></li><li><p><strong>View logs</strong>:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">journalctl</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -u</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># or</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">cat</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /var/log/vm_port_mapping.log</span></span></code></pre></div></li><li><p><strong>Manually trigger rule update</strong>:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> restart</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span></code></pre></div></li></ul><h4 id="common-issues" tabindex="-1">Common Issues <a class="header-anchor" href="#common-issues" aria-label="Permalink to &quot;Common Issues&quot;"></a></h4><h5 id="port-mapping-not-working" tabindex="-1">Port mapping not working <a class="header-anchor" href="#port-mapping-not-working" aria-label="Permalink to &quot;Port mapping not working&quot;"></a></h5><p>Check the following:</p><ul><li>Confirm the service is running: <code>systemctl status vm-port-mapping</code></li><li>Check the log file: <code>cat /var/log/vm_port_mapping.log</code></li><li>Ensure the firewall service is normal: <code>systemctl status firewalld</code></li><li>Verify VM network interface configuration: <code>virsh domiflist VM-name</code></li></ul><h5 id="manually-adding-mapping-rules" tabindex="-1">Manually adding mapping rules <a class="header-anchor" href="#manually-adding-mapping-rules" aria-label="Permalink to &quot;Manually adding mapping rules&quot;"></a></h5><p>Usually, manual addition of rules is not needed, but if necessary:</p><ol><li><p>Stop the service:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> stop</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span></code></pre></div></li><li><p>Edit the mapping file:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">nano</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/vm_port_mapping/mapping.txt</span></span></code></pre></div></li><li><p>Start the service:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> start</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span></code></pre></div></li></ol><h5 id="cleaning-all-rules" tabindex="-1">Cleaning all rules <a class="header-anchor" href="#cleaning-all-rules" aria-label="Permalink to &quot;Cleaning all rules&quot;"></a></h5><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> stop</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">grep</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/vm_port_mapping/mapping.txt</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> |</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> while</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> read</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -r</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm_name</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ip_address</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mac</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ssh_port</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> port_start</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> port_end</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">; </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">do</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> firewall-cmd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --permanent</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --remove-forward-port=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;port=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$ssh_port</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">:proto=tcp:toport=22:toaddr=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$ip_address</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> for</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> ((port</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">port_start; port</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&lt;=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">port_end; port</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">++</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)); </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">do</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> firewall-cmd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --permanent</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --remove-forward-port=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;port=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$port</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">:proto=tcp:toport=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$port</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">:toaddr=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">$ip_address</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">&quot;</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> done</span></span>
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">done</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">firewall-cmd</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --reload</span></span></code></pre></div><h5 id="security-recommendations" tabindex="-1">Security Recommendations <a class="header-anchor" href="#security-recommendations" aria-label="Permalink to &quot;Security Recommendations&quot;"></a></h5><ul><li>Regularly check mapping files and logs to ensure there are no unauthorized mappings</li><li>Do not manually modify files in the <code>/etc/vm_port_mapping/</code> directory unless you fully understand the impact</li><li>Make sure the <code>firewalld</code> service is running properly so that rules can be correctly persisted</li></ul><h4 id="uninstallation-method" tabindex="-1">Uninstallation Method <a class="header-anchor" href="#uninstallation-method" aria-label="Permalink to &quot;Uninstallation Method&quot;"></a></h4><p>To uninstall this service:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> stop</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> disable</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> vm-port-mapping</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">rm</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/systemd/system/vm-port-mapping.service</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">rm</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -f</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /usr/local/sbin/vm_port_mapping_daemon.sh</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">rm</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -rf</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /etc/vm_port_mapping</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> daemon-reload</span></span></code></pre></div><h3 id="_3-2-manual-mapping" tabindex="-1">3.2 Manual Mapping <a class="header-anchor" href="#_3-2-manual-mapping" aria-label="Permalink to &quot;3.2 Manual Mapping&quot;"></a></h3><p>Assume your virtual machine is shown in the user control panel as</p><p><img src="`+n+`" alt="wv1"></p><p>and the host machine command <code>ip a | head -n 15</code> result is</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">1:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> lo:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">LOOPBACK,UP,LOWER_U</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">P</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mtu</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 65536</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> qdisc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> noqueue</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> state</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> UNKNOWN</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> group</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> default</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> qlen</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1000</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> link/loopback</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 00:00:00:00:00:00</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> brd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 00:00:00:00:00:00</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> inet</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 127.0.0.1/8</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> scope</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> host</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> lo</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> valid_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> preferred_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> inet6</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ::1/128</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> scope</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> host</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> valid_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> preferred_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">2:</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ens3:</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">BROADCAST,MULTICAST,UP,LOWER_U</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">P</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> mtu</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1500</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> qdisc</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fq_codel</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> state</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> UP</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> group</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> default</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> qlen</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 1000</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> link/ether</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 52:54:00:f1:d6:8b</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> brd</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ff:ff:ff:ff:ff:ff</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> altname</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> enp0s3</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> inet</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> your_public_IPv4_address/corresponding_subnet_mask</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> scope</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> global</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> noprefixroute</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ens3</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> valid_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> preferred_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> inet6</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 2a0b:4140:4c60::2/48</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> scope</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> global</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> noprefixroute</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> valid_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> preferred_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> inet6</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> fe80::5054:ff:fef1:d68b/64</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> scope</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> link</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> noprefixroute</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> valid_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> preferred_lft</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> forever</span></span></code></pre></div><p>It&#39;s evident that the public IPv4 address is bound to the <code>ens3</code> interface, so we&#39;ll use <code>ens3</code> in the following commands.</p><p>To map the current VM&#39;s port 22 to the public IPv4&#39;s port 3322, use:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Add DNAT rule: Forward public 3322 traffic to host local 192.168.33.130:22</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">iptables</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -t</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nat</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -A</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> PREROUTING</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -i</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ens3</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tcp</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dport</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 3322</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -j</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> DNAT</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --to-destination</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> 192.168.33.130:22</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Add POSTROUTING: Local NAT masquerading for normal return connections</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">iptables</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -t</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> nat</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -A</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> POSTROUTING</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tcp</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -d</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 192.168.33.130</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dport</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 22</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -j</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> MASQUERADE</span></span>
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D;"># Need to allow INPUT port 3322 through (firewalld is enabled by default)</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">iptables</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -I</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> INPUT</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -p</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> tcp</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dport</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 3322</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -j</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ACCEPT</span></span></code></pre></div><p>This way, the internal virtual machine is mapped out and can be remotely logged in directly.</p><h2 id="_4-troubleshooting" tabindex="-1">4. Troubleshooting <a class="header-anchor" href="#_4-troubleshooting" aria-label="Permalink to &quot;4. Troubleshooting&quot;"></a></h2><h3 id="compute-node-addition-error-troubleshooting" tabindex="-1">Compute Node Addition Error Troubleshooting <a class="header-anchor" href="#compute-node-addition-error-troubleshooting" aria-label="Permalink to &quot;Compute Node Addition Error Troubleshooting&quot;"></a></h3><p>Execute on the Controller:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">telnet</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;"> &lt;</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">node</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> i</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">p</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">&gt;</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 8884</span></span></code></pre></div><p>Execute on the compute node:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> status</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> webvirtcompute</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> status</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> libvirtd</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> status</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> prometheus</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">systemctl</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> status</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> prometheus-libvirt-exporter</span></span></code></pre></div><p>If none of the above reveals the problem, then you need to execute on the Controller:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> exec</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -it</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> webvirtcloud-backend</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> /bin/sh</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">vi</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> webvirtcloud/settings/production.py</span></span></code></pre></div><p>Change <code>DEBUG=False</code> to <code>DEBUG=True</code>, save the file, then execute in the container:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">UV_PROJECT_ENVIRONMENT</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583;">=</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;">/usr/local</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;"> uv</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> sync</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> --dev</span></span></code></pre></div><p>Then <code>exit</code> the container and execute:</p><div class="language-shell vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">shell</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> restart</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> webvirtcloud-backend</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">sleep</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> 3</span></span>
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> logs</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> webvirtcloud-backend</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -f</span></span></code></pre></div><p>Then trigger the error in the frontend, and you&#39;ll see the corresponding error in the real-time loaded logs.</p><h3 id="docker-containers-not-auto-restarting-after-controller-reboot" tabindex="-1">Docker Containers Not Auto-Restarting After Controller Reboot <a class="header-anchor" href="#docker-containers-not-auto-restarting-after-controller-reboot" aria-label="Permalink to &quot;Docker Containers Not Auto-Restarting After Controller Reboot&quot;"></a></h3><p>If Docker containers don&#39;t automatically restart after system reboot, execute:</p><div class="language-bash vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">bash</span><pre class="shiki shiki-themes github-light github-dark vp-code" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> start</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;"> $(</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0;">docker</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF;"> ps</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -a</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF;"> -q</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8;">)</span></span></code></pre></div><h2 id="_5-drawbacks" tabindex="-1">5. Drawbacks <a class="header-anchor" href="#_5-drawbacks" aria-label="Permalink to &quot;5. Drawbacks&quot;"></a></h2><p>System images are hard-coded; you can&#39;t use your own custom images, nor export them for use.</p><p>This is not the same project as <a href="https://github.com/retspen/webvirtcloud" target="_blank" rel="noreferrer">https://github.com/retspen/webvirtcloud</a>, don&#39;t confuse them.</p><h2 id="acknowledgements" tabindex="-1">Acknowledgements <a class="header-anchor" href="#acknowledgements" aria-label="Permalink to &quot;Acknowledgements&quot;"></a></h2><p><a href="https://webvirt.cloud/" target="_blank" rel="noreferrer">https://webvirt.cloud/</a></p>`,101)]))}const F=i(l,[["render",p]]);export{g as __pageData,F as default};