0

Good day!

Would like to change my VM Ubuntu Desktop Server 20.04 swap file location and increase it to certain degree, if possible 100GB of swap?

Is there a way to connect my VM (virtualbox) ubuntu to another drive that is connected to my computer?

C drive - 120GB SSD (Windows 10)

D drive - 120GB SSD (Assigned for my VM (ubuntu))

E drive - 3TB HDD (only connected to Windows 10)

Want to assign the swap file to E drive.

1 Answer 1

1

Yes, you can do this. I don't have a Windows machine to tell you exactly what buttons to push, but this is the process for adding another device:

  1. Shut down the Ubuntu VM (if it's running)
  2. Open the "Settings" for your VM
  3. Choose "Storage"
  4. Click on "Controller: SATA" (or whatever storage device you have that is not IDE)
  5. Click the little "Add Hard Disk" icon. This will open another little window.
  6. Choose "Create". This will start a wizard.
  7. Stick with "VDI (VirtualBox Disk Image) as the type
  8. Choose "Dynamically allocated" (there are speed advantages to going with "fixed size", but this will pre-allocate the full size of the disk image immediately rather than allowing it to grow naturally)
  9. Select the location for the VDI file. You can have it anywhere on your machine, even on a USB stick if you are so inclined
  10. Choose the size (up to 2TB)
  11. Press "Create"

That's it for the Windows side. Make sure the new device is added to your Ubuntu VM and press "Start" to boot the VM.

Once in Ubuntu, do this:

  1. Open GParted
  2. Find the device you just added
  3. Create a new partition
  4. Follow this guide to use the partition for swap and updating the system to use that partition

Enjoy your 100GB of swap 👍🏻

1
  • Yo, thanks! I will do this when I get back home. Thank you very much! This looks promising! Jan 15, 2021 at 3:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .