<?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>More &#8211; Cyberillo</title>
	<atom:link href="https://cyberillo.com/category/more/feed/" rel="self" type="application/rss+xml" />
	<link>https://cyberillo.com</link>
	<description>Reliable Tech Tips and Services</description>
	<lastBuildDate>Mon, 30 Jun 2025 06:38:16 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://cyberillo.com/wp-content/uploads/cropped-favicon-100x100.png</url>
	<title>More &#8211; Cyberillo</title>
	<link>https://cyberillo.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to Reset ESXi Root Password on a Standalone Host</title>
		<link>https://cyberillo.com/how-to-reset-esxi-root-password-on-a-standalone-host/</link>
					<comments>https://cyberillo.com/how-to-reset-esxi-root-password-on-a-standalone-host/#respond</comments>
		
		<dc:creator><![CDATA[Sylvan Abela]]></dc:creator>
		<pubDate>Sat, 05 Apr 2025 10:26:14 +0000</pubDate>
				<category><![CDATA[More]]></category>
		<guid isPermaLink="false">https://cyberillo.com/?p=3491</guid>

					<description><![CDATA[<p>A guide to resetting the ESXi root password on a standalone host when other recovery options aren't available.</p>
<p>The post <a rel="nofollow" href="https://cyberillo.com/how-to-reset-esxi-root-password-on-a-standalone-host/">How to Reset ESXi Root Password on a Standalone Host</a> appeared first on <a rel="nofollow" href="https://cyberillo.com">Cyberillo</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>If you&#8217;re reading this, I&#8217;m sorry. You&#8217;re in some trouble, aren&#8217;t you? Don&#8217;t worry! It happens to all of us. Okay &#8211; maybe not all of us &#8211; just the unlucky ones&#8230; or idiots with lack of caution.</p>



<p>Chill! Read this guide &#8211; you&#8217;ll be back in your ESXi host in no time. Well, maybe a few hours &#8211; no more than a day &#8211; promise <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f607.png" alt="😇" class="wp-smiley" style="height: 1em; max-height: 1em;" />.</p>





<h2 class="wp-block-heading">The Problem</h2>



<p>Just to state the obvious&#8230; The problem here is that we can&#8217;t get into the <code>root</code> account on our ESXi host. In addition:</p>



<ul class="wp-block-list">
<li>We have no other administrator accounts</li>



<li>The ESXi host is a standalone and is not managed through vCenter</li>



<li>We have no SSH key pair with which to access the server</li>
</ul>



<p><strong>N.B. </strong>The host in question had ESXi 7.0.3 installed &#8211; This probably works for other versions as well. Furthermore, it seems that earlier versions of ESXi were less secure, so the option mentioned in the <strong><a href="#what-doesnt-work">What doesn&#8217;t work</a></strong> section below could work in earlier versions.</p>



<h2 class="wp-block-heading">Broadcom, you&#8217;re not helpful</h2>



<p>The <a href="https://knowledge.broadcom.com/external/article?legacyId=1317898" target="_blank" rel="noopener">official answer from Broadcom</a> is that&#8230;</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow">
<p>If the host is standalone and not managed by vCenter, then re-installing ESXi is the only option.</p>
</blockquote>


<div class="wp-block-image">
<figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="600" height="327" src="https://cyberillo.com/wp-content/uploads/lies-lieseverywhere.jpg" alt="Lies - Lies Everywhere" class="wp-image-3492" srcset="https://cyberillo.com/wp-content/uploads/lies-lieseverywhere.jpg 600w, https://cyberillo.com/wp-content/uploads/lies-lieseverywhere-300x164.jpg 300w" sizes="(max-width: 600px) 100vw, 600px" /></figure>
</div>


<p><strong>LIEESSSSSS!</strong></p>



<p>What a lame reply. I&#8217;ll admit, what I&#8217;m about to show you is a very shady way to get back into your ESXi host, hackish, to say the least &#8211; but if it works, it works.</p>



<h2 class="wp-block-heading" id="what-doesnt-work">What doesn&#8217;t work <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" /></h2>



<p>Stop! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f91a.png" alt="🤚" class="wp-smiley" style="height: 1em; max-height: 1em;" /> If you&#8217;re in a rush &#8211; which I assume you are &#8211; skip this section altogether. You&#8217;re not getting into your host by reading it. It&#8217;s just me venting <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f624.png" alt="😤" class="wp-smiley" style="height: 1em; max-height: 1em;" />.</p>



<div class="wp-block-kadence-advancedbtn kb-buttons-wrap kb-btns3491_11deb8-6f"><a class="kb-button kt-button button kb-btn3491_22e110-31 kt-btn-size-standard kt-btn-width-type-auto kb-btn-global-fill  kt-btn-has-text-true kt-btn-has-svg-true  wp-block-kadence-singlebtn" href="#solution"><span class="kt-btn-inner-text">Go to the Solution</span><span class="kb-svg-icon-wrap kb-svg-icon-fe_arrowDownCircle kt-btn-icon-side-right"><svg viewBox="0 0 24 24"  fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"  aria-hidden="true"><circle cx="12" cy="12" r="10"/><polyline points="8 12 12 16 16 12"/><line x1="12" y1="8" x2="12" y2="16"/></svg></span></a></div>



<div class="wp-block-kadence-spacer aligncenter kt-block-spacer-3491_acaf5e-24 is-style-wide"><div class="kt-block-spacer kt-block-spacer-halign-center"></div></div>



<p>There are quite a few guides on the interwebs, claiming that just like with any other Linux distro, you can</p>



<ol class="wp-block-list">
<li>Create a bootable Linux ISO &#8211; Ubuntu, Arch &#8211; you name it</li>



<li>Mount the ESXi OS partition in a temporary directory &#8211; <code>sudo mount /dev/sda5 /mnt/sda5</code></li>



<li>Find <em>state.tgz</em> and extract it &#8211; <code>tar -xzf /mnt/sda5/state.tgz -C /tempstate</code></li>



<li>From the extracted contents, extract <em>local.tgz</em> as well &#8211; <code>tar -xzf /tempstate/local.tgz -C /templocal</code></li>



<li>Edit the <em>shadow</em> file from the extracted <em>local.tgz</em> to delete the hash for the root account &#8211; <code>vi /templocal/etc/shadow</code></li>



<li>Pack the shadow file in the <em>local.tgz</em> and then into <em>state.tgz</em>, move the <em>state.tgz</em> back into <em>/mnt/sda5 </em>to replace the old one</li>



<li>Unmount the ESXi OS partition, reboot</li>



<li>Voila! You got the root account with a blank password</li>
</ol>



<p>Right? Nope <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/274c.png" alt="❌" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>



<p>This may have worked for earlier versions of ESXi, but save your time and don&#8217;t even try for ESXi 7.0.3.</p>



<h3 class="wp-block-heading">Why doesn&#8217;t it work?</h3>



<p>For starters, trying to mount the OS partition on a bootable Linux ISO will fail. This isn&#8217;t any regular <em>ext4</em> partition. No, no. This is <em>vmfs</em>.</p>



<p>Okay, no worries there&#8217;s the <em>vmfs-tools</em> package, which can mount <em>vmfs</em> partitions. One problem, it doesn&#8217;t come pre-installed on your typical Linux install media. And no, I didn&#8217;t have an internet connection in my case. So I couldn&#8217;t just install it from the repos.</p>



<p>Doesn&#8217;t matter &#8211; I created a Linux installation media (based on Linux Mint) with <em>vmfs-tools</em> preinstalled. I used <a href="https://github.com/PJ-Singh-001/Cubic" target="_blank" rel="noopener">Cubic</a>. I won&#8217;t get into the details, but it&#8217;s a pretty easy to use tool. Anyways, around one (or two) hours later, I got my installation media with <em>vmfs-tools</em> preinstalled and to no surprise &#8211; <code>vmfs: unsupported version 6</code>. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f621.png" alt="😡" class="wp-smiley" style="height: 1em; max-height: 1em;" /><img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f621.png" alt="😡" class="wp-smiley" style="height: 1em; max-height: 1em;" />You wouldn&#8217;t believe it!  <em>vmfs-tools </em>currently supports up to <em>vmfs </em>version 5, so if you&#8217;re trying to mount a partition formatted with <em>vmfs </em>6 (which is used by newer versions of VMware ESXi), it won&#8217;t work.</p>



<p>No worries, I thought (being overly optimistic and all), I&#8217;ll re-create the bootable Linux media with <em><a href="https://packages.debian.org/sid/vmfs6-tools" target="_blank" rel="noopener">vmfs6-tools</a></em> installed. Surely, that would do it. Oh how I hoped <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f64f.png" alt="🙏" class="wp-smiley" style="height: 1em; max-height: 1em;" />.</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="576" src="https://cyberillo.com/wp-content/uploads/No-no-no-1024x576.png" alt="No No No" class="wp-image-3494" srcset="https://cyberillo.com/wp-content/uploads/No-no-no-1024x576.png 1024w, https://cyberillo.com/wp-content/uploads/No-no-no-300x169.png 300w, https://cyberillo.com/wp-content/uploads/No-no-no-768x432.png 768w, https://cyberillo.com/wp-content/uploads/No-no-no-390x220.png 390w, https://cyberillo.com/wp-content/uploads/No-no-no.png 1248w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>How wrong I was! Reading the <em>vmstorage</em> and <em>datastore </em>partitions worked with the <em>vmfs6-tools</em> installed, but there was no getting to the precious <em>state.tgz</em>. I kept getting the error <code>fsinfo invalid magic number 0x2fabf15f</code>. Not only that, I read about the <em>vmfs6-tools</em> package and found that &#8220;Only read access is available at the moment, but write access is under works. Multiple extents are supported.&#8221; So, even if somehow I managed to access the <em>state.tgz</em> from my bootable Linux media, I was surely not going to replace it with the modified one.</p>



<p>I&#8217;ll be honest, optimistic as I usually am, this was still a battle I had considered lost. Worst part of it all? I had strung along 5 friends on this wild good chase. After looking like an absolute fool getting locked out of the ESXi host in the first place, I had wasted 6 hours of their day trying to get back in, as they offered their ideas, research, solutions, and moral support. </p>



<p>I won&#8217;t even get into the part where I tried to insert the raided OS disks into another ESXi host <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f606.png" alt="😆" class="wp-smiley" style="height: 1em; max-height: 1em;" />.</p>



<p>Let&#8217;s get on to the solution&#8230;</p>



<h2 class="wp-block-heading" id="solution">The Solution <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f4a1.png" alt="💡" class="wp-smiley" style="height: 1em; max-height: 1em;" /></h2>



<p>When all hope was almost lost, we came across this <a href="https://www.mwyann.us/posts/201" target="_blank" rel="noopener">gold mine of an article on Mwyann&#8217;s Weblog</a>. Damn you Google for not putting this in my face sooner!</p>



<p>In a nutshell, what this fellow did, and what we copied&#8230; and essentially, what I&#8217;m showing you here is:</p>



<ol class="wp-block-list">
<li>Install ESXi on another server (or virtual machine).</li>



<li>Use the ESXi installation media to boot on the original host (the one you&#8217;re locked out of).</li>



<li>Go to the BOOTBANK volume and extract the <em>state.tgz</em>. <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">This is encrypted.</mark></li>



<li>Copy the <em>encryption.info </em>and the <em>local.tgz.ve</em> files to a USB.</li>



<li>Go to the new ESXi host and extract <em>state.tgz</em> from the BOOTBANK<em>.</em></li>



<li>Decrypt <em>state.tgz</em> and replace the <em>encryption.info </em>file with the <em>encryption.info</em> file from the original host.</li>



<li>Repack the <em>state.tgz</em> and copy it to the BOOTBANK and reboot. This will trick the new host into using the encryption key from the original host.</li>



<li>Decrypt the <em>local.tgz.ve</em> of the original host from the new host. This is possible since it now has the original host&#8217;s encryption key.</li>



<li>Generate a public/private key pair to SSH into the locked out server.</li>



<li>Add the public key to the authorized_keys file under the <em>/etc/ssh/keys-root</em> folder (from <em>local.tgz</em>).</li>



<li>Add <em>/etc/rc.local.d/local.sh</em> containing a command to start the SSH service on ESXi boot.</li>



<li>Repack the <em>local.tgz </em>and <em>state.tgz</em> and transfer to the original host via USB.</li>



<li>Connect to the original host via SSH through the private key.</li>



<li>Reset the root password <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f972.png" alt="🥲" class="wp-smiley" style="height: 1em; max-height: 1em;" />.</li>
</ol>



<h3 class="wp-block-heading">1. Install ESXi on another server</h3>



<p>Just create a bootable USB for this &#8211; You can use <a href="https://rufus.ie/en/" target="_blank" rel="noopener">Rufus</a>, but I personally prefer <a href="https://www.ventoy.net/en/index.html" target="_blank" rel="noopener">Ventoy</a>. Note that you may need to disable secure boot on your server (or enroll the MOK to the list of trusted keys). </p>



<p>I had a tough time finding the ESXi ISO from Broadcom&#8217;s site. So I&#8217;ll save you the hassle &#8211; God bless the Internet Archive <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f496.png" alt="💖" class="wp-smiley" style="height: 1em; max-height: 1em;" />!</p>



<div class="wp-block-kadence-advancedbtn kb-buttons-wrap kb-btns3491_d3b185-8d"><a class="kb-button kt-button button kb-btn3491_20459a-64 kt-btn-size-standard kt-btn-width-type-auto kb-btn-global-fill  kt-btn-has-text-true kt-btn-has-svg-false  wp-block-kadence-singlebtn" href="https://archive.org/download/vmware-esxi-7/VMware-VMvisor-Installer-7.0U3f-20036589.x86_64.iso" target="_blank" rel="noopener"><span class="kt-btn-inner-text">Download ESXi v7.0.3</span></a></div>



<div class="wp-block-kadence-spacer aligncenter kt-block-spacer-3491_c5ad78-93 is-style-wide"><div class="kt-block-spacer kt-block-spacer-halign-center"></div></div>



<h3 class="wp-block-heading">2. Access the locked host through the ESXi installation media</h3>



<p>Boot your original host (the one you&#8217;re locked out of) using the ESXi installation media you created in the previous step. At the ESXi installation screen hit <strong>Alt + F1</strong> to enter into a shell. Enter username <code>root</code> and hit enter when prompted for the password. It&#8217;s blank.</p>



<figure class="wp-block-image size-full"><img decoding="async" width="1024" height="768" src="https://cyberillo.com/wp-content/uploads/ESXi-installation-screen.png" alt="ESXi installation screen" class="wp-image-3498" srcset="https://cyberillo.com/wp-content/uploads/ESXi-installation-screen.png 1024w, https://cyberillo.com/wp-content/uploads/ESXi-installation-screen-300x225.png 300w, https://cyberillo.com/wp-content/uploads/ESXi-installation-screen-768x576.png 768w" sizes="(max-width: 1024px) 100vw, 1024px" /></figure>



<p>When you list the volumes (<code>ls /vmfs/volumes</code>) you&#8217;ll see your <code>BOOTBANK1</code>, <code>BOOTBANK2</code>, <code>OSDATA_xxxxx</code>, <code>datastore1</code> &#8211; plus some additional volumes you may have created. That&#8217;s right you can view the volumes from the old host when you boot on it with an ESXi installation media.</p>



<p>In our case, we only had to work on BOOTBANK1, but you might need to repeat this procedure on both bootbanks if they were both being used in your case. For simplicity, I will continue the rest of the guide with BOOTBANK1.</p>



<h3 class="wp-block-heading">3. Extract <em>state.tgz</em> from the locked host</h3>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mkdir /mylosthost
tar xzf /vmfs/volumes/BOOTBANK1/state.tgz -C /mylosthost
ls /mylosthost</pre>



<p>You&#8217;ll see that when extracting the <em>state.tgz</em> from the BOOTBANK we don&#8217;t get the expected <em>local.tgz</em>, but rather an encrypted <em>local.tgz.ve</em> together with an <em>encryption.info</em> file.</p>



<p>You would typically decrypt the <em>local.tgz.ve</em> using the below command, but since we&#8217;re booted from the ESXi installation media, we won&#8217;t be able to decrypt it.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">crypto-util envelope extract --aad ESXConfiguration local.tgz.ve local.tgz</pre>



<p>So, the solution is to trick the new host to use the <em>encryption.info</em> from the locked host such that it&#8217;s able to decrypt the <em>local.tgz.ve</em> file.</p>



<h3 class="wp-block-heading">4. Copy <em>local.tgz.ve</em> and <em>encryption.info</em> to USB</h3>



<p>Okay, so insert a USB drive into the locked out host. Format it as FAT32 not NTFS &#8211; ESXi is more friendly with FAT. You should be able to see it in the list of volumes (<code>ls /vmfs/volumes</code>).</p>



<p>Copy the <em>encryption.info </em>and <em>local.tgz.ve</em> files to the USB drive. Remember we have them in a temporary directory we created <em><code>/mylocalhost</code></em>.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cp -r /mylosthost /vmfs/volumes/MYUSBDRIVE/mylosthost</pre>



<h3 class="wp-block-heading">5. Extract <em>state.tgz </em>from the new ESXi host</h3>



<div style="border-radius: 15px; background-color: #A1D6B2; color: #000;padding: 15px; margin-bottom: 30px">
<p><strong>BONUS STEP:</strong> During this process we encountered issues reading the USB drive while booted directly from the ESXi host, but no issues while booted from the installation media. So, it&#8217;d probably be wise for you to boot the new host with the installation media, copy the files from the USB drive to the bootbank (since this is retained on next boot) and then reboot again to the ESXi on the new host.</p>
</div>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cp -r /vmfs/volumes/MYUSBDRIVE/mylosthost /vmfs/volumes/BOOTBANK1/mylosthost</pre>



<p>Boot up the new ESXi host  and hit <strong>F2</strong> to customize the system. Enter the password you set during the installation and then go to <strong>Troubleshooting Options</strong>. From here, you can enable shell access.</p>



<p>Then, hit <strong>Alt + F1</strong> to open up a shell. Logon with the root account and navigate to the bootbank via either <em><code>/vmfs/volumes/BOOTBANK1</code></em> or <em><code>/bootbank</code></em>. We need to extract its <em>state.tgz</em> file.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mkdir /mynewhost
tar xzf /vmfs/volumes/BOOTBANK1/state.tgz -C /mynewhost
ls /mynewhost</pre>



<p>You see the <em>encryption.info</em> and <em>local.tgz.ve</em> files. Differently from step 3, we can decrypt the <em>local.tgz.ve</em> file because we&#8217;re logged in to our host properly (not from the bootable installation media). </p>



<h3 class="wp-block-heading">6. Decrypt <em>state.tgz</em> and replace <em>encryption.info</em></h3>



<p>Okay, now decrypt the <em>local.tgz.ve</em> file to get the <em>local.tgz</em> file. Then, delete the <em>local.tgz.ve</em> file and <em>encryption.info files</em> and copy the <em>encryption.info</em> file from the locked host (remember that we transferred it to this host via USB in the previous bonus step).</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd /mynewhost
crypto-util envelope extract --aad ESXConfiguration local.tgz.ve local.tgz
rm -f local.tgz.ve
rm -f encryption.info
cp /vmfs/volumes/BOOTBANK1/mylosthost/encryption.info /mynewhost/encryption.info
ls /mynewhost</pre>



<p>In the <em>/mynewhost</em> directory you should now have a <em>local.tgz</em> file (from the new host) and the <em>encryption.info</em> file (from the old host).</p>



<h3 class="wp-block-heading">7. Trick the new host to use the locked host&#8217;s encryption key</h3>



<p>This part is very important, so please pay close attention to the next steps. </p>



<p>At this step of the process, we&#8217;re booted on the new host. The next step is to trick it to use the locked host&#8217;s encryption key, <span style="text-decoration: underline;">but we cannot do this while booted into it</span>, we have to be booted via the ESXi installation media. </p>



<p>Trust me, don&#8217;t try to do it, because the state will be overwritten on reboot and it won&#8217;t work.</p>



<p>But if we shut off now, we won&#8217;t be able to access the <em>/mynewhost</em> directory from the ESXi installation media. So, let&#8217;s copy this folder to the <em>BOOTBANK1 </em>volume which will still be accessible while booted from the installation media. </p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cp -r /mynewhost /vmfs/volumes/BOOTBANK1/mynewhost</pre>



<p>Okay, now we&#8217;ll restart the new host, boot up from the ESXi installation media, and open up a shell with <strong>Alt + F1</strong>. As before, we&#8217;ll login with username <code>root</code> and a blank password.</p>



<p>As you recall from the previous step, in the <em>/vmfs/volumes/BOOTBANK1/mynewhost</em> directory you should now have a <em>local.tgz</em> file (from the new host) and the <em>encryption.info</em> file (from the old host).</p>



<p>Let&#8217;s pack them back into <em>state.tgz</em> and replace the new host&#8217;s <em>state.tgz</em> with this new updated state (that uses the original host&#8217;s <em>encryption.info</em> file)</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rm -f /vmfs/volumes/BOOTBANK1/state.tgz
cd /vmfs/volumes/BOOTBANK1/mynewhost
tar czf /vmfs/volumes/BOOTBANK1/state.tgz encryption.info local.tgz</pre>



<p>Now that the <em>state.tgz</em> of the new host has been replaced, we can reboot into the new ESXi. Now the new host is using the original host&#8217;s encryption key so we&#8217;ll be able to decrypt the <em>local.tgz.ve</em> file that we copied over from the locked host via USB.</p>



<h3 class="wp-block-heading">8. Decrypt the locked host&#8217;s <em>local.tgz.ve</em></h3>



<p>Back into the shell of the new host, we can navigate to the directory in which we copied the locked host&#8217;s <em>local.tgz.ve</em> and decrypt it. This time, it will work because we are using the old host&#8217;s encryption key on the new host.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd /vmfs/volumes/BOOTBANK1/mylosthost
crypto-util envelope extract --aad ESXConfiguration local.tgz.ve local.tgz
tar xzf local.tgz
ls</pre>



<p>Awesome! You can see that we extracted the <em>etc</em> directory (and some other directories) from the locked host&#8217;s <em>local.tgz</em>. Unfortunately, the <em>shadow </em>file is nowhere to be found in the <em>etc</em> directory, so this won&#8217;t be as simple as deleting the root account&#8217;s hash from the shadow file.</p>



<p>What we&#8217;ll do instead is create a public/private key pair and add the public key to the authorized_keys in <em>/etc/ssh/keys-root</em>. This will enable us to SSH into the locked host.</p>



<h3 class="wp-block-heading">9. Generate public/private key pair for SSH</h3>



<p>On a separate Linux machine generate the SSH key pair using <code>ssh-keygen</code>.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ssh-keygen -t rsa -b 4096</pre>



<p>Optionally, set a passphrase on your private key&#8230; Make sure you don&#8217;t forget this one <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f61c.png" alt="😜" class="wp-smiley" style="height: 1em; max-height: 1em;" />.</p>



<p>I also renamed the public key from <em>mypublickey.pub</em> to <em>authorized_keys</em>. This made the next step easier for me, because I could copy the file directly to <em>/etc/ssh/keys-root</em> (that will be packed to the state of the locked host). So your <em>authorized_keys</em> file should look as follows with a single public key (the one you just generated). Make sure to update the user at the end of the public key to <em>root@thenameofyourlockedhost</em>.</p>



<figure class="wp-block-image size-full"><img loading="lazy" decoding="async" width="988" height="97" src="https://cyberillo.com/wp-content/uploads/ssh-public-key-example.png" alt="ssh public key example" class="wp-image-3524" srcset="https://cyberillo.com/wp-content/uploads/ssh-public-key-example.png 988w, https://cyberillo.com/wp-content/uploads/ssh-public-key-example-300x29.png 300w, https://cyberillo.com/wp-content/uploads/ssh-public-key-example-768x75.png 768w" sizes="auto, (max-width: 988px) 100vw, 988px" /></figure>



<h3 class="wp-block-heading">10. Add the <em>authorized_keys</em> file to <em>/etc/ssh/keys-root</em></h3>



<p>Copy the <em>authorized_keys </em>file to your FAT32 formatted USB drive and then transfer it to the new host. You might need to boot from the ESXi installation media if the USB is not visible in <em>/vmfs/volumes</em>.</p>



<p>From the USB drive, we need to copy the <em>authorized_keys</em> to the <em>/etc/ssh/keys-root</em> directory. In my case I needed to create the <em>keys-root</em> directory because it was not present in the <em>/etc/ssh</em> folder.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mkdir /vmfs/volumes/BOOTBANK1/mylosthost/etc/ssh/keys-root
cp /vmfs/volumes/MYUSBDRIVE/authorized_keys /vmfs/volumes/BOOTBANK1/mylosthost/etc/ssh/keys-root/authorized_keys</pre>



<h3 class="wp-block-heading">11. Add <em>/etc/rc.local.d/local.sh</em> to start SSH service on ESXi boot</h3>



<p>This step could be optional for you, but if you&#8217;re not sure, follow along because it&#8217;s a small step relative to the entire process.</p>



<p>For added security, we prefer to keep the SSH service switched off on our ESXi hosts. With SSH disabled, it won&#8217;t be possible to access the locked host via the SSH private key we generated earlier. So what we need to do is instruct the locked host to start the SSH service as it boots up. We do this by modifying the <em>local.sh</em> and packing it into the <em>state.tgz</em> that we&#8217;ll transfer to the locked host.</p>



<p>So, on the new host:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">mkdir /vmfs/volumes/BOOTBANK1/mylosthost/etc/rc.local.d
vi /vmfs/volumes/BOOTBANK1/mylosthost/etc/rc.local.d/local.sh</pre>



<p>Your <em>local.sh</em> should look as follows<em>:</em></p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">#!/bin/sh

/etc/init.d/SSH start

exit 0</pre>



<h3 class="wp-block-heading">12. Transfer the modified state to the locked host</h3>



<p>Now, that we have our public key in the <em>authorized_keys</em> file and the <em>/etc/init.d/SSH start</em> command in the <em>local.sh</em> file, we can repack everything and transfer the modified state to the locked host.</p>



<p>In my case, in addition to <em>/etc</em>, I had another 2 directories that were extracted from <em>local.tgz</em>. I made sure to repack them as well in the final <em>tgz</em> file, although I&#8217;m not sure if it makes a difference.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd /vmfs/volumes/BOOTBANK1/mylosthost
tar czf /vmfs/volumes/MYUSBDRIVE/local.tgz etc dir1 dir2
tar czf /vmfs/volumes/MYUSBDRIVE/state.tgz /vmfs/volumes/MYUSBDRIVE/local.tgz</pre>



<p>With the updated state in the USB drive, we need to reboot the locked host one last time from the ESXi installation media. Enter a shell and transfer <em>state.tgz</em> to the BOOTBANK.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rm -f /vmfs/volumes/BOOTBANK1/state.tgz
cp /vmfs/volumes/MYUSBDRIVE/state.tgz /vmfs/volumes/BOOTBANK1/state.tgz</pre>



<p>Okay, we updated the state of the locked host. Time for a reboot&#8230; Hold your breath!</p>



<p><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color">Remember &#8211; you may need to repeat the above steps for both BOOTBANK1 &amp; BOOTBANK2 if they were both being used by your locked ESXi host.</mark> If your BOOTBANK2 only contains a <em>boot.cfg</em> file, you&#8217;re in luck it&#8217;s not being used by your locked host.</p>



<h3 class="wp-block-heading">13. SSH into the locked host using the private key</h3>



<p>If all went well, your locked host should be up and running after the reboot. The SSH service should be started as well. So, the next step is to connect to it using the private key.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">ssh -i myprivatekey root@mylockedhost</pre>



<p>At long last, you should now be logged on to your ESXi host with the <code>root</code> account.</p>



<p>You may stop holding your breath <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f601.png" alt="😁" class="wp-smiley" style="height: 1em; max-height: 1em;" />.</p>



<h3 class="wp-block-heading">14. Reset root password</h3>



<p>You&#8217;ve gotten this far. One final step is to reset the <code>root</code> password &#8211; don&#8217;t lose it this time!</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">passwd</pre>



<h2 class="wp-block-heading">That&#8217;s All Folks</h2>



<p>I hope this guide has been helpful to get you back into your ESXi host. If you&#8217;re still clueless, or need help with some of the steps, feel free to reach out. I&#8217;ll be happy to help.</p>



<div class="wp-block-kadence-advancedbtn kb-buttons-wrap kb-btns3491_9bc027-0f"><a class="kb-button kt-button button kb-btn3491_ecea9d-87 kt-btn-size-standard kt-btn-width-type-auto kb-btn-global-fill  kt-btn-has-text-true kt-btn-has-svg-true  wp-block-kadence-singlebtn" href="https://cyberillo.com/contact/"><span class="kt-btn-inner-text">Contact</span><span class="kb-svg-icon-wrap kb-svg-icon-fe_phoneCall kt-btn-icon-side-right"><svg viewBox="0 0 24 24"  fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"  aria-hidden="true"><path d="M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"/></svg></span></a></div>
<p>The post <a rel="nofollow" href="https://cyberillo.com/how-to-reset-esxi-root-password-on-a-standalone-host/">How to Reset ESXi Root Password on a Standalone Host</a> appeared first on <a rel="nofollow" href="https://cyberillo.com">Cyberillo</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberillo.com/how-to-reset-esxi-root-password-on-a-standalone-host/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Install Kali Linux on Windows 11 (2 Easy Ways)</title>
		<link>https://cyberillo.com/how-to-install-kali-linux-on-windows/</link>
					<comments>https://cyberillo.com/how-to-install-kali-linux-on-windows/#respond</comments>
		
		<dc:creator><![CDATA[Sylvan Abela]]></dc:creator>
		<pubDate>Tue, 24 Sep 2024 04:21:04 +0000</pubDate>
				<category><![CDATA[More]]></category>
		<guid isPermaLink="false">https://cyberillo.com/?p=3270</guid>

					<description><![CDATA[<p>Learn how to easily install Kali Linux on Windows 10 or 11 using WSL or Hyper-V. Get started with ethical hacking in minutes!</p>
<p>The post <a rel="nofollow" href="https://cyberillo.com/how-to-install-kali-linux-on-windows/">How to Install Kali Linux on Windows 11 (2 Easy Ways)</a> appeared first on <a rel="nofollow" href="https://cyberillo.com">Cyberillo</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<figure class="wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio"><div class="wp-block-embed__wrapper">
<iframe loading="lazy" title="How to Install Kali Linux on Windows" width="1220" height="686" src="https://www.youtube.com/embed/5ovDzVeqhUg?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
</div></figure>



<p>Installing Kali Linux on Windows is a straightforward process that lets you access one of the most popular Linux distributions for cybersecurity and penetration testing directly from your Windows machine. Whether you’re a security professional, an ethical hacker, or someone looking to explore digital forensics, getting Kali Linux up and running on your Windows 10 or 11 system offers a powerful toolset right at your fingertips.</p>



<p>This tutorial will guide you through two methods to install Kali Linux: via the Windows Subsystem for Linux (WSL) and using Hyper-V. Both approaches allow you to integrate a Linux environment into Windows, but each offers its unique advantages. If you&#8217;re more interested in lightweight integration, WSL might be your best bet. If you prefer running Kali in a virtual machine with more control, Hyper-V is the way to go. Let&#8217;s dive into the details.</p>





<h2 class="wp-block-heading" id="method-1-how-to-install-kali-linux-on-wsl-windows-subsystem-for-linux">Method 1: How to Install Kali Linux on WSL (Windows Subsystem for Linux)</h2>



<p>To begin, you’ll need to enable the&nbsp;<strong>Windows Subsystem for Linux (WSL)</strong>&nbsp;and the&nbsp;<strong>Virtual Machine Platform</strong>&nbsp;features. These components are necessary to ensure your system can run a Linux kernel directly on Windows.</p>



<ol class="wp-block-list">
<li>Navigate to the control panel and select <strong>Programs > Turns Windows features on or off</strong>.</li>
</ol>



<figure class="wp-block-image size-full border"><img loading="lazy" decoding="async" width="1112" height="485" src="https://cyberillo.com/wp-content/uploads/Turn-windows-features-on-or-off-in-control-panel.png" alt="Turn windows features on or off in control panel" class="wp-image-3274" srcset="https://cyberillo.com/wp-content/uploads/Turn-windows-features-on-or-off-in-control-panel.png 1112w, https://cyberillo.com/wp-content/uploads/Turn-windows-features-on-or-off-in-control-panel-300x131.png 300w, https://cyberillo.com/wp-content/uploads/Turn-windows-features-on-or-off-in-control-panel-1024x447.png 1024w, https://cyberillo.com/wp-content/uploads/Turn-windows-features-on-or-off-in-control-panel-768x335.png 768w" sizes="auto, (max-width: 1112px) 100vw, 1112px" /></figure>



<ol start="2" class="wp-block-list">
<li>Enable the <strong>Virtual Machine Platform &amp; Windows Subsystem for Linux</strong> features.<br><br>Using the&nbsp;<strong>Windows Subsystem Linux</strong>&nbsp;feature on Windows 11 or 10 allows you to run a Linux environment natively, with deep integration into the Windows file system. It’s user-friendly, making it ideal for those who want to install Kali Linux without dealing with a full virtual machine setup.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="565" height="499" src="https://cyberillo.com/wp-content/uploads/Enable-Virtual-Machine-Platform-and-WSL-features.png" alt="Enable Virtual Machine Platform and WSL features" class="wp-image-3272" style="width:429px;height:auto" srcset="https://cyberillo.com/wp-content/uploads/Enable-Virtual-Machine-Platform-and-WSL-features.png 565w, https://cyberillo.com/wp-content/uploads/Enable-Virtual-Machine-Platform-and-WSL-features-300x265.png 300w" sizes="auto, (max-width: 565px) 100vw, 565px" /></figure>
</div>


<ol start="3" class="wp-block-list">
<li>Click on <strong>OK</strong> and reboot your machine for the changes to take effect. After rebooting, your system will be ready to install Linux distributions, including Kali Linux.</li>



<li>Then, open up the Windows Store and search for <strong>Kali Linux</strong>.</li>
</ol>



<figure class="wp-block-image size-large border"><img loading="lazy" decoding="async" width="1024" height="523" src="https://cyberillo.com/wp-content/uploads/Search-for-Kali-Linux-in-the-Microsoft-Store-1024x523.png" alt="Search for Kali Linux in the Microsoft Store" class="wp-image-3273" srcset="https://cyberillo.com/wp-content/uploads/Search-for-Kali-Linux-in-the-Microsoft-Store-1024x523.png 1024w, https://cyberillo.com/wp-content/uploads/Search-for-Kali-Linux-in-the-Microsoft-Store-300x153.png 300w, https://cyberillo.com/wp-content/uploads/Search-for-Kali-Linux-in-the-Microsoft-Store-768x392.png 768w, https://cyberillo.com/wp-content/uploads/Search-for-Kali-Linux-in-the-Microsoft-Store.png 1392w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ol start="5" class="wp-block-list">
<li>Select the first search result and click on <strong>Get</strong>.<br><br>This process may take a few minutes depending on your internet connection and system performance.</li>
</ol>



<figure class="wp-block-image size-large border"><img loading="lazy" decoding="async" width="1024" height="618" src="https://cyberillo.com/wp-content/uploads/Click-on-Get-to-install-Kali-Linux-from-the-Microsoft-Store-1024x618.png" alt="Click on Get to install Kali Linux from the Microsoft Store" class="wp-image-3271" srcset="https://cyberillo.com/wp-content/uploads/Click-on-Get-to-install-Kali-Linux-from-the-Microsoft-Store-1024x618.png 1024w, https://cyberillo.com/wp-content/uploads/Click-on-Get-to-install-Kali-Linux-from-the-Microsoft-Store-300x181.png 300w, https://cyberillo.com/wp-content/uploads/Click-on-Get-to-install-Kali-Linux-from-the-Microsoft-Store-768x463.png 768w, https://cyberillo.com/wp-content/uploads/Click-on-Get-to-install-Kali-Linux-from-the-Microsoft-Store-780x470.png 780w, https://cyberillo.com/wp-content/uploads/Click-on-Get-to-install-Kali-Linux-from-the-Microsoft-Store.png 1315w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ol start="6" class="wp-block-list">
<li>Once the download is complete, click on <strong>Open</strong>. This will install and register the Kali Linux distribution in WSL.</li>



<li>When prompted, enter a username and password for your account.</li>
</ol>



<figure class="wp-block-image size-large border"><img loading="lazy" decoding="async" width="1024" height="354" src="https://cyberillo.com/wp-content/uploads/Enter-username-and-password-to-finish-Kali-Linux-installation-1024x354.png" alt="Enter username and password to finish Kali Linux installation" class="wp-image-3275" srcset="https://cyberillo.com/wp-content/uploads/Enter-username-and-password-to-finish-Kali-Linux-installation-1024x354.png 1024w, https://cyberillo.com/wp-content/uploads/Enter-username-and-password-to-finish-Kali-Linux-installation-300x104.png 300w, https://cyberillo.com/wp-content/uploads/Enter-username-and-password-to-finish-Kali-Linux-installation-768x266.png 768w, https://cyberillo.com/wp-content/uploads/Enter-username-and-password-to-finish-Kali-Linux-installation.png 1073w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ol start="8" class="wp-block-list">
<li>Congratulations! You’ve successfully installed Kali Linux on your Windows 11 machine using WSL. You can now launch it directly from the Start menu, and start using Kali’s powerful tools for&nbsp;cybersecurity&nbsp;and&nbsp;penetration testing.</li>
</ol>



<h2 class="wp-block-heading" id="method-2-how-to-install-kali-linux-on-hyper-v">Method 2: How to Install Kali Linux on Hyper-V</h2>



<p>For users who prefer using a virtual machine, installing Kali Linux via&nbsp;<strong>Hyper-V</strong>&nbsp;offers a more isolated and robust environment. This method is ideal for those who want a virtualized instance of Kali Linux, running as a separate machine on your Windows operating system.</p>



<p>First, we&#8217;ll need to download the Kali Linux&nbsp;<strong>Virtual Machine</strong>&nbsp;image. On the official Kali Linux website, under the&nbsp;<strong>Pre-built Virtual Machines</strong>&nbsp;section, you’ll find options for various virtualization platforms like&nbsp;<strong>VMware</strong>&nbsp;and&nbsp;<strong>VirtualBox</strong>, but for this guide, we’re focusing on&nbsp;<strong>Hyper-V</strong>.</p>



<ol class="wp-block-list">
<li>Head over to the <a href="https://www.kali.org/get-kali/#kali-platforms" target="_blank" rel="noopener">Kali Linux download page</a> and click on the <strong>Virtual Machines</strong> option.</li>
</ol>



<figure class="wp-block-image size-large border"><img loading="lazy" decoding="async" width="1024" height="490" src="https://cyberillo.com/wp-content/uploads/Select-Virtual-Machines-from-the-Kali-Linux-Download-Page-1024x490.png" alt="Select Virtual Machines from the Kali Linux Download Page" class="wp-image-3278" srcset="https://cyberillo.com/wp-content/uploads/Select-Virtual-Machines-from-the-Kali-Linux-Download-Page-1024x490.png 1024w, https://cyberillo.com/wp-content/uploads/Select-Virtual-Machines-from-the-Kali-Linux-Download-Page-300x143.png 300w, https://cyberillo.com/wp-content/uploads/Select-Virtual-Machines-from-the-Kali-Linux-Download-Page-768x367.png 768w, https://cyberillo.com/wp-content/uploads/Select-Virtual-Machines-from-the-Kali-Linux-Download-Page-1536x735.png 1536w, https://cyberillo.com/wp-content/uploads/Select-Virtual-Machines-from-the-Kali-Linux-Download-Page.png 1746w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ol start="2" class="wp-block-list">
<li>Under the <strong>Pre-built Virtual Machines</strong> page, select <strong>Hyper-V</strong>. Make sure you choose the correct version of Kali Linux for your system. If you’re using a 64-bit Windows system (which most users are), select the 64-bit version.</li>
</ol>



<figure class="wp-block-image size-large border"><img loading="lazy" decoding="async" width="1024" height="594" src="https://cyberillo.com/wp-content/uploads/Select-Hyper-V-from-the-pre-built-virtual-machines-page-1024x594.png" alt="Select Hyper-V from the pre-built virtual machines page" class="wp-image-3279" srcset="https://cyberillo.com/wp-content/uploads/Select-Hyper-V-from-the-pre-built-virtual-machines-page-1024x594.png 1024w, https://cyberillo.com/wp-content/uploads/Select-Hyper-V-from-the-pre-built-virtual-machines-page-300x174.png 300w, https://cyberillo.com/wp-content/uploads/Select-Hyper-V-from-the-pre-built-virtual-machines-page-768x446.png 768w, https://cyberillo.com/wp-content/uploads/Select-Hyper-V-from-the-pre-built-virtual-machines-page.png 1437w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<ol start="3" class="wp-block-list">
<li>Once the download is complete extract the .7z archive using <a href="https://www.7-zip.org/" target="_blank" rel="noopener">7-zip</a> or a similar tool.</li>



<li>Open&nbsp;<strong>PowerShell</strong>&nbsp;with administrator rights and use the command line to navigate to where you extracted the archive. This will allow you to execute the script to create the virtual machine.</li>
</ol>



<pre class="EnlighterJSRAW" data-enlighter-language="powershell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">cd path/to/your/extracted/archive</pre>



<ol start="5" class="wp-block-list">
<li>Create the Kali Linux virtual machine by running the PowerShell script.</li>
</ol>



<pre class="EnlighterJSRAW" data-enlighter-language="powershell" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
.\create-vm.ps1</pre>



<ol start="6" class="wp-block-list">
<li>Once the script completes, you can open&nbsp;<strong>Hyper-V Manager</strong>&nbsp;and locate your newly created Kali Linux virtual machine. Hyper-V gives you more control over the virtual environment, with options to allocate memory, processors, and more.</li>



<li>Double-click to connect to the VM and then click on <strong>Start</strong>.</li>
</ol>


<div class="wp-block-image">
<figure class="aligncenter size-full is-resized"><img loading="lazy" decoding="async" width="677" height="523" src="https://cyberillo.com/wp-content/uploads/Click-on-Start-to-power-on-the-Kali-Linux-virtual-machine.png" alt="Click on Start to power on the Kali Linux virtual machine" class="wp-image-3280" style="width:451px;height:auto" srcset="https://cyberillo.com/wp-content/uploads/Click-on-Start-to-power-on-the-Kali-Linux-virtual-machine.png 677w, https://cyberillo.com/wp-content/uploads/Click-on-Start-to-power-on-the-Kali-Linux-virtual-machine-300x232.png 300w" sizes="auto, (max-width: 677px) 100vw, 677px" /></figure>
</div>


<ol start="8" class="wp-block-list">
<li>After the Virtual Machine boots up, you can log in to your Kali Linux environment with the default credentials.</li>
</ol>



<ul class="wp-block-list">
<li><code>Username: <strong>kali</strong></code></li>



<li><code>Password: <strong>kali</strong></code></li>
</ul>



<ol start="9" class="wp-block-list">
<li>Congratulations! Your Kali Linux virtual environment&nbsp;is fully set up, and you can start using it for&nbsp;penetration testing,&nbsp;cybersecurity tasks, and more.</li>
</ol>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="1024" height="573" src="https://cyberillo.com/wp-content/uploads/Kali-Linux-in-Hyper-V-1024x573.png" alt="Kali Linux in Hyper-V" class="wp-image-3281" srcset="https://cyberillo.com/wp-content/uploads/Kali-Linux-in-Hyper-V-1024x573.png 1024w, https://cyberillo.com/wp-content/uploads/Kali-Linux-in-Hyper-V-300x168.png 300w, https://cyberillo.com/wp-content/uploads/Kali-Linux-in-Hyper-V-768x430.png 768w, https://cyberillo.com/wp-content/uploads/Kali-Linux-in-Hyper-V-1536x859.png 1536w, https://cyberillo.com/wp-content/uploads/Kali-Linux-in-Hyper-V.png 1623w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure>



<h2 class="wp-block-heading" id="faq-kali-linux-installation-on-windows">Frequently Asked Questions</h2>



<p><strong>What is the Windows Subsystem for Linux (WSL)?</strong><br>WSL allows you to run a full Linux distribution on your Windows machine without the need for a virtual machine. It integrates Linux tools directly into the Windows environment, making it ideal for lightweight tasks and software development.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>Can I install Kali Linux on both Windows 10 and Windows 11?</strong><br>Yes, you can install Kali Linux on both Windows 10 and 11 using WSL. However, WSL 2 is recommended for better performance, which is natively supported in Windows 11 and can be manually enabled on Windows 10.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>How do I enable the Windows Subsystem for Linux?</strong><br>Go to the Control Panel, navigate to &#8220;Programs &gt; Turn Windows features on or off,&#8221; and enable both the <strong>Windows Subsystem for Linux</strong> and <strong>Virtual Machine Platform</strong> features. After enabling them, reboot your system to apply the changes.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>What are the default credentials for logging into Kali Linux?</strong><br>If you’re using the Hyper-V method, the default username and password are both <code>kali</code>. For WSL, you will be prompted to create your own username and password during the installation process.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>What are the main differences between WSL and Hyper-V for running Kali Linux?</strong><br>WSL offers seamless integration into Windows and uses fewer system resources, making it ideal for quick access to Linux tools. Hyper-V provides a full virtual machine with isolated resources, which is better suited for more complex tasks that require a dedicated environment.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>How much disk space does Kali Linux require on WSL?</strong><br>The initial installation of Kali Linux on WSL will require around 2-3 GB of space, but this can grow depending on the tools you install. Make sure to have enough disk space available on your system.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>Do I need to reboot after enabling WSL features?</strong><br>Yes, after enabling the WSL and Virtual Machine Platform features, you need to restart your machine for the changes to take effect.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>Can I use VirtualBox or VMware instead of Hyper-V to run Kali Linux?</strong><br>Yes, you can use <strong>VirtualBox</strong> or <strong>VMware</strong> to install Kali Linux as a virtual machine. However, this guide specifically focuses on <strong>Hyper-V</strong>, which is built into Windows and doesn&#8217;t require third-party software.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>How do I update Kali Linux once installed?</strong><br>Once Kali Linux is installed, open the terminal and run the following command to update all packages:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo apt update &amp;&amp; sudo apt upgrade</pre>



<p>This will ensure your system has the latest security updates and software.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>Can I dual boot Kali Linux and Windows?</strong><br>While this guide focuses on using WSL and Hyper-V, you can also dual boot Kali Linux with Windows. This method requires partitioning your hard drive and installing Kali Linux as a separate operating system. Dual booting is more complex but offers the advantage of running Linux natively.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>I want to learn penetration testing. Is Kali Linux the right tool for me?</strong><br>Yes, Kali Linux is widely used by cybersecurity professionals and ethical hackers for penetration testing and digital forensics. It comes pre-installed with a wide range of tools like <strong>nmap</strong>, <strong>Metasploit</strong>, and <strong>Wireshark</strong>, which are essential for these tasks.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>What if I encounter errors during the installation process?</strong><br>If you run into any issues during installation, common troubleshooting steps include:</p>



<ul class="wp-block-list">
<li>Verifying that your Windows version supports WSL 2 or Hyper-V.</li>



<li>Ensuring you’ve enabled the necessary features (WSL, Virtual Machine Platform, or Hyper-V).</li>



<li>Checking your internet connection during the download phase.<br>For more specific issues, consult the Kali Linux documentation or community forums.</li>
</ul>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>How do I start using Kali Linux after installation?</strong><br>After installing via WSL, you can launch Kali Linux by searching for &#8220;Kali&#8221; in the Start menu. For Hyper-V, you’ll use <strong>Hyper-V Manager</strong> to start the virtual machine. Once started, you can use the terminal for all Linux commands and tools.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>Is using Kali Linux on WSL or Hyper-V suitable for production environments?</strong><br>For most users, running Kali Linux on WSL or Hyper-V is ideal for learning, development, and testing purposes. However, production environments often require more robust virtualization or dedicated systems, especially for security-critical operations.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p><strong>Can I install additional Linux tools after setting up Kali Linux?</strong><br>Absolutely! You can use the terminal in Kali Linux to install additional tools. For example, to install <code>nmap</code>, run:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="bash" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo apt install nmap</pre>



<p>Kali Linux is highly flexible and customizable for any additional tools you may need.</p>



<hr class="wp-block-separator has-alpha-channel-opacity"/>



<p>This FAQ should help clarify any questions you may have during the process of installing Kali Linux on your Windows machine.</p>



<h2 class="wp-block-heading" id="c">Conclusion</h2>



<p>Both methods allow you to install Kali Linux on your Windows machine, but the choice depends on how you want to use the operating system. WSL offers a lighter, more integrated approach with the Windows environment, ideal for users who want quick access to Linux tools and a simplified setup. Meanwhile, Hyper-V provides a more controlled, virtualized instance of Kali Linux, making it a solid choice for those who want full isolation and greater flexibility in managing resources.</p>



<p>No matter which method you choose, you’ll have Kali Linux ready to go, with access to its full suite of&nbsp;ethical hacking&nbsp;and&nbsp;cybersecurity tools, from&nbsp;<strong>nmap</strong>&nbsp;to&nbsp;<strong>Metasploit</strong>. Whether you&#8217;re looking to perform&nbsp;digital forensics, test&nbsp;network security, or simply familiarize yourself with the Linux environment, Kali Linux on Windows provides a versatile platform to start exploring.</p>



<p>With either installation method, you&#8217;ll have access to a robust&nbsp;Debian-based Linux distribution, widely regarded as one of the best options for&nbsp;cybersecurity&nbsp;and&nbsp;penetration testing. Now, it&#8217;s time to start using Kali Linux and dive into the world of&nbsp;ethical hacking&nbsp;and&nbsp;digital security&nbsp;right from your&nbsp;Windows machine!</p>
<p>The post <a rel="nofollow" href="https://cyberillo.com/how-to-install-kali-linux-on-windows/">How to Install Kali Linux on Windows 11 (2 Easy Ways)</a> appeared first on <a rel="nofollow" href="https://cyberillo.com">Cyberillo</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberillo.com/how-to-install-kali-linux-on-windows/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to Delete a Directory in Linux</title>
		<link>https://cyberillo.com/how-to-delete-a-directory-in-linux/</link>
					<comments>https://cyberillo.com/how-to-delete-a-directory-in-linux/#respond</comments>
		
		<dc:creator><![CDATA[Sylvan Abela]]></dc:creator>
		<pubDate>Sat, 21 Sep 2024 12:52:57 +0000</pubDate>
				<category><![CDATA[More]]></category>
		<guid isPermaLink="false">https://cyberillo.com/?p=3261</guid>

					<description><![CDATA[<p>Learn how to delete directories in Linux using rm -rf and rmdir. Remove files and folders effortlessly, even non-empty ones!</p>
<p>The post <a rel="nofollow" href="https://cyberillo.com/how-to-delete-a-directory-in-linux/">How to Delete a Directory in Linux</a> appeared first on <a rel="nofollow" href="https://cyberillo.com">Cyberillo</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Learning how to&nbsp;delete a directory&nbsp;is one of the simplest, yet key tasks for any&nbsp;Linux user. Whether you want to remove empty&nbsp;directories, or clean up a&nbsp;folder&nbsp;that contains multiple&nbsp;files and subdirectories, there are specific&nbsp;commands you can use. This guide will walk you through how to&nbsp;effectively delete folders, and their contents using&nbsp;Linux command line&nbsp;tools like&nbsp;<code>rm</code>&nbsp;and&nbsp;<code>rmdir</code>.</p>





<h2 class="wp-block-heading" id="how-to-delete-an-empty-directory-in-linux">How to Delete an Empty Directory in Linux</h2>



<p>If you need <strong>to&nbsp;delete an empty directory</strong>, the&nbsp;<code>rmdir</code>&nbsp;command&nbsp;is your best option. This command is designed to&nbsp;remove a directory in Linux&nbsp;as long as it contains <strong>no files or subdirectories</strong>.</p>



<p>Here’s the&nbsp;command to <strong>remove&nbsp;an empty&nbsp;folder</strong>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rmdir directory_name
</pre>



<p>For example, if you have a folder called&nbsp;<code>backup_folder</code>&nbsp;and it’s empty, you can delete it by running the&nbsp;following command:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rmdir backup_folder
</pre>



<h2 class="wp-block-heading" id="how-to-delete-a-non-empty-directory">How to Delete a Non-Empty Directory</h2>



<p>When a&nbsp;<strong>directory contains files</strong>&nbsp;or other subdirectories, you can’t use&nbsp;<code>rmdir</code>. Instead, the&nbsp;<code>rm</code>&nbsp;command&nbsp;with the&nbsp;<code>-r</code>&nbsp;or&nbsp;<code>-rf</code>&nbsp;flags will&nbsp;<strong>recursively</strong>&nbsp;delete a directory and its contents. The&nbsp;<code>-r</code>&nbsp;flag tells the system to&nbsp;<strong>recursively remove</strong>&nbsp;not only the directory but all the files and subdirectories within it.</p>



<p>The syntax to&nbsp;delete a directory&nbsp;and its contents is:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rm -r directory_name
</pre>



<p>Let’s say you want to delete&nbsp;<code>backup_folder</code>&nbsp;and it contains files. The&nbsp;rm command&nbsp;with the&nbsp;<code>-r</code>&nbsp;flag will handle it:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rm -r backup_folder
</pre>



<p>If you need to delete the folder without any prompts, add the&nbsp;<code>-f</code>&nbsp;flag, which forces the system to delete everything without asking for confirmation <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-vivid-red-color"><strong>even if the files in the directory are write-protected!</strong></mark></p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rm -rf backup_folder
</pre>



<p>Using&nbsp;<code>rm -rf</code>&nbsp;allows users to&nbsp;delete&nbsp;directories and their contents in a&nbsp;Linux system. This is a powerful command, so always double-check to avoid&nbsp;deleting the wrong&nbsp;files, especially if you&#8217;re dealing with&nbsp;critical files. A&nbsp;case of accidental&nbsp;deletion is hard to reverse.</p>



<h2 class="wp-block-heading" id="removing-multiple-directories-in-linux-using-wildcards">Removing Multiple Directories in Linux Using Wildcards</h2>



<p>In&nbsp;Linux distributions, you can use wildcards to remove several directories at once. For instance, if you have multiple&nbsp;folders&nbsp;that begin with the same prefix, such as&nbsp;<code>backup_</code>, you can remove them all with this&nbsp;Linux command:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">rm -r backup_*
</pre>



<p>This command will delete all directories and their contents that match the pattern. This is particularly useful if you want to clear out old&nbsp;backup directories&nbsp;or redundant folders.</p>



<h2 class="wp-block-heading" id="using-sudo-and-root-access">Using Sudo and Root Access</h2>



<p>In some cases, you may need&nbsp;<strong>root access</strong>&nbsp;to delete certain directories, especially if they are <strong>system directories</strong> or&nbsp;<strong>write-protected</strong>. To&nbsp;<strong>delete a directory</strong>&nbsp;with elevated permissions, you can use&nbsp;<code>sudo</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">sudo rm -rf /path/to/directory
</pre>



<p>Be cautious when using&nbsp;<code>sudo rm -rf</code>, as it can&nbsp;permanently remove&nbsp;directories and&nbsp;files&nbsp;without the chance of recovery.</p>



<h2 class="wp-block-heading" id="avoid-accidental-deletion">Avoid Accidental Deletion</h2>



<p>If you&#8217;re concerned about&nbsp;accidentally deleting&nbsp;important files, you can create an&nbsp;alias&nbsp;for the&nbsp;<code>rm</code>&nbsp;command that always prompts for confirmation. Add this to your&nbsp;<code>.bashrc</code>&nbsp;or&nbsp;<code>.bash_profile</code>:</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="false" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">alias rm='rm -i'</pre>



<p>This forces&nbsp;<code>rm</code>&nbsp;to ask for confirmation before&nbsp;deleting files or directories, adding an extra layer of safety.</p>



<h2 class="wp-block-heading" id="deleting-directories-in-a-graphical-environment-gui">Deleting Directories in a Graphical Environment (GUI)</h2>



<p>For those using a&nbsp;graphical&nbsp;interface, most&nbsp;Linux systems&nbsp;come with file managers that allow users to manage and&nbsp;delete directories&nbsp;with just a few clicks. Though the&nbsp;command line&nbsp;offers more control, the&nbsp;GUI&nbsp;is convenient for basic tasks like&nbsp;removing a folder&nbsp;or&nbsp;deleting a file in Linux.</p>



<p></p>
<p>The post <a rel="nofollow" href="https://cyberillo.com/how-to-delete-a-directory-in-linux/">How to Delete a Directory in Linux</a> appeared first on <a rel="nofollow" href="https://cyberillo.com">Cyberillo</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://cyberillo.com/how-to-delete-a-directory-in-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
