0553: Export Proxmox VE VM for Use With VirtualBox

This commit is contained in:
i12bretro 2021-09-06 05:05:00 -04:00
parent e538f663fc
commit 9ddbd81afd

137
0553.html Normal file
View file

@ -0,0 +1,137 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Export Proxmox VE VM for Use With VirtualBox</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script type="text/javascript">
$(function(){
$('textarea').each(function(i,e){
theTextarea = $(this);
theTextarea.height((theTextarea[0].scrollHeight-5) +'px');
});
$('li').each(function(i,e){
var uuid = 'li_' + Math.floor(Math.random() * Math.floor(1000000)).toString() + '_' + i.toString();
$(this).contents().wrap('<span id="'+ uuid +'"><label for="cb_'+ uuid +'"></label></span>');
$(this).prepend('<input type="checkbox" class="completeBox" id="cb_' + uuid +'" rel="'+ uuid +'" />')
});
$('code,div.codeBlock,textarea.codeBlock').each(function(i,e){
theElement = $(this);
var lines = theElement.html().split("\n");
theElement.empty();
for(l=0;l<lines.length;l++){
if($.trim(lines[l]) != '' && $.trim(lines[l]).substr(0,1) != '#' && $.trim(lines[l]).indexOf(' #') == -1 && lines[l].substr(0, 4).toUpperCase() != 'REM '){
theElement.append('<input type="image" src="images/clipboard.png" value="" class="copy-text" rel="copy_'+ i +'_'+ l +'" data-clipboard-text="'+ lines[l].replace(/"/g, '&quot;') +'" /><span id="copy_'+ i +'_'+ l +'">'+ lines[l] +'</span>');
} else {
theElement.append(lines[l]);
}
}
});
$(document).on('click','input.copy-text',function(){
theButton = $(this);
$('input.copy-text').attr('src','images/clipboard.png');
$('span.copy-animation,span.copy-animation-ps').removeClass('copy-animation copy-animation-ps');
try {
if($('#'+ theButton.attr('rel')).parent('div').hasClass('PS')){
$('#'+ theButton.attr('rel')).addClass('copy-animation-ps');
} else if($('#'+ theButton.attr('rel')).parent('div').hasClass('CMD')){
$('#'+ theButton.attr('rel')).addClass('copy-animation-cmd');
} else {
$('#'+ theButton.attr('rel')).addClass('copy-animation');
}
navigator.clipboard.writeText(theButton.data('clipboard-text').replace(/<[^>]*>?/gm, ''));
theButton.attr('src','images/clipboard_active.png');
} catch(err) {
}
return false;
});
$(document).on('click','input.completeBox',function(){
theBox = $(this);
$('#'+ theBox.attr('rel')).addClass('strikethrough');
theBox.prop('disabled',true);
theBox.parent('li').prevAll().each(function(i,e){
theLI = $(this);
if(theLI.find('input[type=checkbox]').not(':checked')){
$('#'+ theLI.find('input[type=checkbox]').attr('rel')).addClass('strikethrough');
theLI.find('input[type=checkbox]').prop('checked',true).prop('disabled',true);
}
});
});
if(window.self !== window.top){
window.parent.$('iframe.stepsFrame').height((this['scrollingElement']['scrollHeight']+20) +'px');
}
});
</script>
<link href="css/steps.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="gridContainer">
<div class="topMargin"></div>
<div id="listName" class="topMargin">
<h1>Export Proxmox VE VM for Use With VirtualBox</h1>
</div>
<div></div>
<div id="content">
<p>NOTE: In this tutorial I&#39;ll be backing up the VM to an existing network share. For details on how to add a network share to Proxmox, check out this tutorial <a href="https://youtu.be/hkrFZoiYX_0?t=47" target="_blank">https://youtu.be/hkrFZoiYX_0?t=47</a></p>
<h2>Export the VM from Proxmox VE</h2>
<ol>
<li>Log into the Proxmox VE web UI</li>
<li>Select the VM from the left navigation menu</li>
<li>Select Backup from the left sub-navigation menu</li>
<li>Click the Backup now button towards the top of the page</li>
<li>Set the destination location, the Mode to Stop and the Compression to none &gt; Click Backup</li>
<li>After the backup operation has completed, select the Proxmox node from the left navigation menu</li>
<li>Select Shell from the left sub-navigation menu</li>
<li>Change directory to the location of the vma backup file, this will vary based on your specific setup
<div class="codeBlock CMD"># change directory to view mounted shares<br />
cd /mnt/pve<br />
# list mounted shares<br />
ls<br />
# cd into dump directory on the specific share, ISOs in this example<br />
cd ISOs/dump<br />
# list the files in the share<br />
ls</div>
</li>
<li>The backup .vma file and a .log file should be displayed</li>
<li>Extract the .vma file using the vma command line tool
<div class="codeBlock CMD"># extract the .vma<br />
# usage: vma extract -v &lt;vzdump-filename.vma&gt; &lt;destination directory&gt;<br />
vma extract -v filename.vma ./export</div>
</li>
<li>Wait for the .vma to be extracted, resulting in a .raw disk image</li>
</ol>
<h2>Converting and Importing the Disk to VirtualBox</h2>
<ol>
<li>Launch VirtualBox Manager</li>
<li>Create a new VM, using the same/similar hardware specifications as the Proxmox VM</li>
<li>Choose to not create a virtual hard disk</li>
<li>With the VM created, right click the VM in the left navigation menu &gt; Show in Explorer</li>
<li>Copy the exported .raw disk image to the VirtualBox VM folder</li>
<li>Hold the SHIFT key and right click in the white space &gt; Open PowerShell window here...</li>
<li>Run the following command to convert the .raw disk image to .vdi
<div class="codeBlock PS"># list .raw files<br />
Get-ChildItem -File -Filter *.raw |Select Directory, Name, Extension<br />
# usage: vboxmanage.exe convertfromraw &lt;input-filename.raw&gt; &lt;output-filename.vdi&gt;<br />
Invoke-Expression (&#39;&amp; &quot;&#39;+ $Env:Programfiles +&#39;\Oracle\VirtualBox\VBoxManage.exe&quot; convertfromraw &quot;.\input-filename.raw&quot; &quot;.\output-filename.vdi&quot;&#39;)</div>
</li>
<li>Back in VirtualBox Manager, select the VM and Click Settings</li>
<li>Select Storage from the left navigation menu</li>
<li>Click Add Storage Attachment &gt; Add Hard Disk &gt; Choose existing disk</li>
<li>Click Add and browse to the newly converted .vdi file</li>
<li>Click OK to all open VirtualBox dialog windows</li>
<li>Right click the VM &gt; Select Start &gt; Normal</li>
</ol>
</div>
</div>
</body>
</html>