<?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: Vuk Stojkovic</title>
    <description>The latest articles on DEV Community by Vuk Stojkovic (@stojkovicv).</description>
    <link>https://dev.to/stojkovicv</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%2F1227797%2F5a02eb67-1c51-479f-846d-68a36aee8211.jpeg</url>
      <title>DEV Community: Vuk Stojkovic</title>
      <link>https://dev.to/stojkovicv</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/stojkovicv"/>
    <language>en</language>
    <item>
      <title>Extending Virtual Machine memory</title>
      <dc:creator>Vuk Stojkovic</dc:creator>
      <pubDate>Sun, 05 May 2024 17:24:58 +0000</pubDate>
      <link>https://dev.to/stojkovicv/extending-virtual-machine-memory-a0n</link>
      <guid>https://dev.to/stojkovicv/extending-virtual-machine-memory-a0n</guid>
      <description>&lt;p&gt;Have you ever been in situation where you don't have enough memory in your virtual machine? As the matter of fact, this issue was very urgent in my case. Namely, I used Oracle VM Ubuntu 20.04 LTS machine in order to run ROS (Robotic Operating System) application. This one required that very specific Ubuntu version, and since I've been using 22.04 as the main OS, I proceeded with Oracle VM.&lt;/p&gt;

&lt;p&gt;During installation, I dedicated 50GB for the entire VM image, without any idea how robust ROS application actually is. ROS automated script stalled in the middle of the installation due to lack of memory. Getting completely new VM image with the more memory was time consuming, and I was sure that there must be a quicker way to extend the existing disk memory. And I was right.&lt;/p&gt;

&lt;p&gt;Oracle Virtual machine is essentially a &lt;code&gt;.vdi&lt;/code&gt; file stored in your local system. All I had to do was to resize (expand in my case) existing allocated memory. Above-mentioned &lt;code&gt;.vdi&lt;/code&gt; file is located at:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;~/VirtualBox VMs/Ubuntu 20.04&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;The command used to extend the disk size was:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;VBoxManage modifyhd "Ubuntu 20.04.vdi" --resize 122880&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Resize flag will accept disk size in Mb, which was 120GB in this case.&lt;/p&gt;

&lt;p&gt;Finally, I had to use &lt;a href="https://gparted.org/"&gt;GParted&lt;/a&gt; in order to memory changes within the VM disk. The idea was to use &lt;a href="https://downloads.sourceforge.net/gparted/gparted-live-1.6.0-3-amd64.iso"&gt;GParted ISO file&lt;/a&gt; to boot your VM. It comes with a simply GUI that helps you to manually enable memory expansion of selected partition.&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Step are following:&lt;/u&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download GParted ISO file&lt;/li&gt;
&lt;li&gt;Configure your VM  to boot it: &lt;em&gt;Settings&lt;/em&gt; -&amp;gt; &lt;em&gt;Storage&lt;/em&gt;. Under &lt;em&gt;Controller: IDE&lt;/em&gt;, right click on &lt;em&gt;Empty&lt;/em&gt; disk, using &lt;em&gt;Optical Drive&lt;/em&gt; disk icon on the right side select &lt;em&gt;Choose a disk file&lt;/em&gt; in order to identify GParted iso file.
OK!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Starting VM will boot GParted partition manager.&lt;br&gt;
You will have to go through 3 basic configuration steps at the beginning, to choose the Keymaps (no keymaps), Language (British, my dear) and the way how to start GParted (&lt;code&gt;automatically&lt;/code&gt; - can't be wrong).&lt;/p&gt;

&lt;p&gt;Voilà!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcvtahxm0bf9psfjl4iah.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcvtahxm0bf9psfjl4iah.png" alt="Booting GParted" width="800" height="508"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Start &lt;em&gt;GParted&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;You will notice that &lt;code&gt;/dev/sda2/&lt;/code&gt; partition, in the &lt;em&gt;File System&lt;/em&gt; column have a &lt;code&gt;extended&lt;/code&gt; tag. Right click on to &lt;em&gt;Resize/Move&lt;/em&gt;. Drag the rectangular till the end, or manually enter extended disk size in MBs and click &lt;em&gt;Resize/Move&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpwvxn7ux8htz9x2q8h0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffpwvxn7ux8htz9x2q8h0.png" alt="Resizing disk space" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Next, conduct the same step for &lt;code&gt;/dev/sda5&lt;/code&gt; partition and &lt;em&gt;Apply all operations&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvqxt1k5iiejuhauovef.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpvqxt1k5iiejuhauovef.png" alt="Apply operations" width="800" height="472"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Upon successful finish, &lt;em&gt;Exit&lt;/em&gt; and turn off VM. Good thing - GParted just extended disk size, and it won't reboot again. It was short-term helper that saved my day and disappeared immediately. Lovely.&lt;/p&gt;

&lt;p&gt;Now all you have to do is to ensure that your disk size is extended. Simple command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;df -h&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Check your partition, and &lt;em&gt;Avail&lt;/em&gt; column.&lt;/p&gt;

&lt;p&gt;That should be it.&lt;/p&gt;

&lt;p&gt;Hopefully you'll find this quick post useful, as it was for me. GParted can be generally used to manage your partitions, or to, for instance, format you external devices. Pretty handy tool.&lt;/p&gt;

&lt;p&gt;Have a good one! 😊&lt;/p&gt;

</description>
      <category>linux</category>
      <category>virtualmachine</category>
      <category>memory</category>
      <category>extending</category>
    </item>
  </channel>
</rss>
