gyf304 / vmcli

A set of utilities (vmcli + vmctl) for macOS Virtualization.framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to resize vm volume

JeffCT0216 opened this issue · comments

Hi there,

I followed the instructions in the readme and tried to increase the vm volume to 16G by:
dd if=/dev/null of="${VMCTLDIR}/ubuntu/disk.img" bs=1g count=0 seek=16

I can see that in my vm folder the disk.img size increase to 16G

total 3171224
-rw-r--r-- 1 ctsai staff 17179869184 Sep 13 10:51 disk.img
drwx------ 3 ctsai staff 96 Sep 12 15:00 screen
-rw-r--r-- 1 ctsai staff 13 Sep 7 11:17 0.ipaddr
-rw-r--r-- 1 ctsai staff 128 Sep 7 10:25 vm.conf
drwxr-xr-x 7 ctsai staff 224 Sep 7 10:20 ubuntu
-rw-r--r-- 1 ctsai staff 13 Jun 14 08:54 0.macaddr
-rw-r--r-- 1 ctsai staff 851 Jun 14 08:53 user.yaml
-rw-r--r-- 1 ctsai staff 27621838 Jun 14 08:52 initrd
-rw-r--r-- 1 ctsai staff 13672704 Jun 14 08:52 vmlinux

but when I start the vm I only see 1.4G storage:

Welcome to Ubuntu 20.04.4 LTS (GNU/Linux 5.4.0-117-generic x86_64)

System information as of Tue Sep 13 17:53:47 UTC 2022

System load: 0.05
Usage of /: 98.9% of 1.40GB
Memory usage: 9%
Swap usage: 0%
Processes: 109
Users logged in: 0
IPv4 address for enp0s1: 192.168.65.3
IPv6 address for enp0s1: fd73:e176:203:8e05:4c8c:42ff:fe46:31b8

=> / is using 98.9% of 1.40GB

0 updates can be applied immediately.

The list of available updates is more than a week old.
To check for new updates run: sudo apt update

Last login: Mon Sep 12 22:00:34 UTC 2022 on hvc0

Can anyone point me in the right direction here?
Thanks

If you resize the VM after the VM has been already booted, you'll need to manually resize the fs. Usually sudo resize2fs /dev/vda will do.

This worked for me, thanks a lot!