<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: whaleshark</title>
    <description>The latest articles on DEV Community by whaleshark (@whaleshark271).</description>
    <link>https://dev.to/whaleshark271</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F378124%2F98773e5c-da99-4459-899a-de254e4b4fe4.JPG</url>
      <title>DEV Community: whaleshark</title>
      <link>https://dev.to/whaleshark271</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/whaleshark271"/>
    <language>en</language>
    <item>
      <title>Using Qemu on Windows 10 Home Edition</title>
      <dc:creator>whaleshark</dc:creator>
      <pubDate>Sat, 02 May 2020 16:25:20 +0000</pubDate>
      <link>https://dev.to/whaleshark271/using-qemu-on-windows-10-home-edition-4062</link>
      <guid>https://dev.to/whaleshark271/using-qemu-on-windows-10-home-edition-4062</guid>
      <description>&lt;p&gt;Recently I had an assignment that asked us to use Qemu. It took me some trouble to get it running on Windows so I thought I could document it here in case I need it in the future. It would be nice if this helps someone, too!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download Qemu and .iso&lt;/li&gt;
&lt;li&gt;Add Qemu path to environment variables settings&lt;/li&gt;
&lt;li&gt;Create an image&lt;/li&gt;
&lt;li&gt;Starting the VM&lt;/li&gt;
&lt;li&gt;Some problems you might encounter&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  1. Download Qemu and .iso
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.qemu.org/download/#windows" rel="noopener noreferrer"&gt;Click here&lt;/a&gt; to download Qemu and download your desired .iso file. After installing Qemu, open Windows Powershell and type &lt;code&gt;qemu-img&lt;/code&gt;. Now you might see that it does not recognize the command. This takes us to number 2.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Add Qemu path to environment variables settings
&lt;/h2&gt;

&lt;p&gt;Copy the Qemu path (should be &lt;code&gt;C:\Program Files\qemu&lt;/code&gt; if you didn't change anything) and open environment variables settings by &lt;code&gt;Right click on "This PC" -&amp;gt; Properties -&amp;gt; Advanced system settings -&amp;gt; Environment Variables&lt;/code&gt;.&lt;br&gt;
Click on &lt;code&gt;path&lt;/code&gt; once and click "Edit...". Click "New" and paste the Qemu path.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=al1cnTjeayk" rel="noopener noreferrer"&gt;Here's the youtube video&lt;/a&gt; that taught me how to do this. Otherwise, I'd stuck here forever :P.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Create an image
&lt;/h2&gt;

&lt;p&gt;Now you can create an image by typing &lt;code&gt;qemu-img create -f qcow2 [name].qcow2 30G&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F16xmu67njkkc190heqh1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F16xmu67njkkc190heqh1.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Starting the VM
&lt;/h2&gt;

&lt;p&gt;When starting the VM, you would want to use an accelerator, or else it is going to take a lot of time installing the OS. It took me more than an hour to install Ubuntu 16.04 without the accelerator.&lt;/p&gt;

&lt;p&gt;For Windows, there are two options: HAXM and whpx. &lt;strong&gt;Note that HAXM can only be used on Windows Enterprise/Pro/Education&lt;/strong&gt; so I'm not going to introduce it here. Although I did get it working for whatever reason and after a Windows update, it just stopped working.🤔&lt;/p&gt;

&lt;p&gt;Go to &lt;code&gt;Windows Features&lt;/code&gt; and tick &lt;code&gt;Windows Hypervisor Platform&lt;/code&gt;. After that, restart the computer and type this command in the powershell (in the directory where the image and .iso resides): &lt;code&gt;qemu-system-x86_64 -accel whpx -hda .\[name].qcow2 -m 512 -net nic,model=virtio -net user -cdrom .\[name].iso -vga std -boot strict=on&lt;/code&gt;. It should start up and you can proceed to install the OS.&lt;/p&gt;

&lt;p&gt;The second time you start up the machine you don't need to type &lt;code&gt;-cdrom&lt;/code&gt; anymore. Just &lt;code&gt;qemu-system-x86_64 -accel whpx -hda .\[name].qcow2 -m 512 -net nic,model=virtio -net user -vga std -boot strict=on&lt;/code&gt; should do it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyg1y1bs0e64dhls5ndr5.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyg1y1bs0e64dhls5ndr5.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Some problems you might encounter
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;You might get stuck when rebooting after installing the OS&lt;/strong&gt;&lt;br&gt;
My friend and I both encountered the problem and we both used Ubuntu 16.04 for the VM. Just close the window and restart it and it should work fine. Pretty sure this is not best practice, though.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;You can't seem to do migration using whpx&lt;/strong&gt;&lt;br&gt;
I got this error when trying to do migration. I found &lt;a href="https://github.com/qemu/qemu/blob/master/target/i386/whpx-all.c" rel="noopener noreferrer"&gt;this Github code&lt;/a&gt; and I think it has something to do with whpx. I'm not sure how to resolve this. My TA simply allowed me to do migration on the server.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwxpgbq7s1xt7gkx5lzmq.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwxpgbq7s1xt7gkx5lzmq.jpg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Untick &lt;code&gt;Windows Hypervisor Platform&lt;/code&gt; when using VirtualBox&lt;/strong&gt;
You might get an error from VirtualBox when starting the machine if you keep it ticked. Remember to untick it.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>qemu</category>
      <category>windows</category>
    </item>
  </channel>
</rss>
