deb http://download.virtualbox.org/virtualbox/debian bionic contrib
"\ndeb http://download.virtualbox.org/virtualbox/debian bionic contrib
' >> /etc/apt/sources.list/!\ NOT TESTED YET : Define the install source in /etc/apt/sources.list : deb http://download.virtualbox.org/virtualbox/debian buster contrib ==> inspired by https://wiki.debian.org/VirtualBox#Oracle_Virtualbox_third-party_repository
An obvious preliminary to all this is to shut down the virtual machine using the virtual disk you're about to remove.
Unplugging a virtual disk from a virtual machine is easily done within the virtual machine Configuration | Storage screens but :UUID: dfea5b73-2683-4d6a-9965-a34a51235162
Parent UUID: base
State: created
Type: normal (base)
Location: C:\Users\kevin\VirtualBox VMs\myVirtualMachine\NewVirtualDisk1.vdi
Storage format: VDI
Capacity: 100 MBytes
Encryption: disabled
Note the UUID of the disk you want to purge
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Once the new disk has been created, you can boot the virtual machine, log in, and confirm the disk is here with lsblk.
if still not ok (experimental) : kill -15 $(pgrep pulseaudio) && systemctl restart alsa-state.service; systemctl restart alsa-restore.service ==> :-/ I'm afraid everything is fine on guest side, and things go wrong between guest/host :-( on host side, give higher priority to 'VboxSVC.exe' process ==> testing... ==> Virtualbox crashed 1 hour after that :-D (at least, that was expected!!!) after rebooting host + guest : untick "enable audio input" in VM settings ==> nope :-(
/dev/mapper/caramba--vg-root 8.2G 5.4G 2.4G 70% / this is getting tight
/dev/mapper/caramba--vg-home 24G 1014M 22G 5% /home
/dev/mapper/caramba--vg-tmp 360M 2.1M 335M 1% /tmp
/dev/mapper/caramba--vg-var 2.7G 549M 2.0G 22% /var
PV VG Fmt Attr PSize PFree /dev/sda5 caramba-vg lvm2 a-- 39.76g 0
Disk /dev/sda: 40 GiB, 53687091200 bytes, 104857600 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x26504200
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 499711 497664 243M 83 Linux
/dev/sda2 501758 83884031 83382274 39.8G 5 Extended
/dev/sda5 501760 83884031 83382272 39.8G 8e Linux LVM this is the one I'd like to enlarge
0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%This should be done in only a few seconds.
Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors
Unpartitioned space /dev/sda: 40 GiB, 42950721536 bytes, 83888128 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 512 bytes Start End Sectors Size 83884032 167772159 83888128 40G
Command (m for help): n Partition type p primary (1 primary, 1 extended, 2 free) l logical (numbered from 5) Select (default p): p Partition number (3,4, default 3): First sector (499712-167772159, default 499712): 83884032 Last sector, +sectors or +size{K,M,G,T,P} (83884032-167772159, default 167772159): Created a new partition 3 of type 'Linux' and of size 40 GiB.
Command (m for help): p
Disk /dev/sda: 80 GiB, 85899345920 bytes, 167772160 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x26504200
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 499711 497664 243M 83 Linux
/dev/sda2 501758 83884031 83382274 39.8G 5 Extended
/dev/sda3 83884032 167772159 83888128 40G 83 Linux
/dev/sda5 501760 83884031 83382272 39.8G 8e Linux LVM
Partition table entries are not in disk order. true, but mainly cosmetic. Can be left as-is.
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Re-reading the partition table failed.: Device or resource busy The kernel still uses the old table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8).partprobe
Physical volume "/dev/sda3" successfully created.
PV VG Fmt Attr PSize PFree
/dev/sda3 lvm2 --- 40.00g 40.00g here it is!
/dev/sda5 caramba-vg lvm2 a-- 39.76g 0
VG #PV #LV #SN Attr VSize VFree
caramba-vg 1 5 0 wz--n- 39.76g 0 only 1 VG, so no big trouble
Volume group "caramba-vg" successfully extended
VG #PV #LV #SN Attr VSize VFree caramba-vg 2 5 0 wz--n- 79.76g 40.00g
/dev/mapper/caramba--vg-root 8.2G 5.4G 2.4G 70% / this one
/dev/mapper/caramba--vg-home 24G 1014M 22G 5% /home
/dev/mapper/caramba--vg-tmp 360M 2.1M 335M 1% /tmp
/dev/mapper/caramba--vg-var 2.7G 549M 2.0G 22% /var
Size of logical volume caramba-vg/root changed from 8.38 GiB (2145 extents) to 20.00 GiB (5120 extents). Logical volume caramba-vg/root successfully resized. resize2fs 1.43.3 (04-Sep-2016) Filesystem at /dev/mapper/caramba--vg-root is mounted on /; on-line resizing required old_desc_blocks = 1, new_desc_blocks = 2 The filesystem on /dev/mapper/caramba--vg-root is now 5242880 (4k) blocks long.
/dev/mapper/caramba--vg-root 20G 5.4G 14G 29% / /dev/mapper/caramba--vg-home 24G 1017M 22G 5% /home /dev/mapper/caramba--vg-tmp 360M 2.1M 335M 1% /tmp /dev/mapper/caramba--vg-var 2.7G 549M 2.0G 22% /var
storageDir/VM_1/image.vdi
storageDir/VM_2/image.vdi
storageDir/VM_n/image.vdi
This works the same whether the VM is on or off, no need to shut it down if it's already running.
Verifying archive integrity... All good. Uncompressing VirtualBox 5.2.18 Guest Additions for Linux........ VirtualBox Guest Additions installer Removing installed version 5.2.16 of VirtualBox Guest Additions... Copying additional installer modules ... Installing additional modules ... VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules. This may take a while. VirtualBox Guest Additions: Running kernel modules will not be replaced until the system is restarted VirtualBox Guest Additions: Starting. VirtualBox Guest Additions: modprobe vboxsf failed if you see this, read that Press Return to close this window...