E: You have not enough free space /var/cache/apt/archives/

Discussions related to using VirtualBox on Linux hosts.
Locked
Dirk_Lehmann
Posts: 60
Joined: 4. Oct 2015, 22:27

E: You have not enough free space /var/cache/apt/archives/

Post by Dirk_Lehmann »

Some php-applications show me I got not enough free space on my (Ubuntu 16,04) Linux server running as VM on (Ubuntu 16.04) Linux host, see df -h executed in the running VM:

Code: Select all

root@ubuntu:/home/dirk# df -h
Dateisystem                 Größe Benutzt Verf. Verw% Eingehängt auf
udev                         2,9G       0  2,9G    0% /dev
tmpfs                        597M     31M  567M    6% /run
/dev/mapper/ubuntu--vg-root  5,4G    5,1G     0  100% /
tmpfs                        3,0G    4,0K  3,0G    1% /dev/shm
tmpfs                        5,0M       0  5,0M    0% /run/lock
tmpfs                        3,0G       0  3,0G    0% /sys/fs/cgroup
/dev/sda1                    472M     58M  390M   13% /boot
tmpfs                        597M       0  597M    0% /run/user/1004
tmpfs                        597M       0  597M    0% /run/user/1000
/home/dirk/.Private          5,4G    5,1G     0  100% /home/dirk
The harddisk where the vdi file is saved looks like this and vdi should be set to dynamic (by the way, how to show / check this if this vdi is set to dynamic or static with the CLI command VBoxManage):

Code: Select all

dirk@ubuntu:/media/dirk/59b80d1c-3259-4cf7-b56e-0b24d55f1111$ df -h
Dateisystem                 Größe Benutzt Verf. Verw% Eingehängt auf
udev                          16G       0   16G    0% /dev
tmpfs                        3,2G    218M  3,0G    7% /run
/dev/mapper/ubuntu--vg-root   85G     16G   66G   20% /
tmpfs                         16G    268K   16G    1% /dev/shm
tmpfs                        5,0M    4,0K  5,0M    1% /run/lock
tmpfs                         16G       0   16G    0% /sys/fs/cgroup
/dev/sda2                    473M    219M  231M   49% /boot
/dev/sda1                    511M    3,4M  508M    1% /boot/efi
tmpfs                        4,8G       0  4,8G    0% /var/cache/unifi-video
tmpfs                        3,2G     60K  3,2G    1% /run/user/1000
/home/dirk/.Private           85G     16G   66G   20% /home/dirk
/dev/md0                     917G    359G  512G   42% /media/dirk/59b80d1c-3259-4cf7-b56e-0b24d55f1111
/dev/sdd1                     55G    2,0G   51G    4% /media/dirk/aa14e361-6aff-4d42-8a7b-78c8fba2c759
Because I want to install php-apps at the server running in VM and also after a while the server in the VM starts quitting some thinks I am wondering how to figure out btw if vdi is dynamic whith VBoxManage (in GUI it showed my dynamic) and how to set guest system to use the free space of the host-system?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: E: You have not enough free space /var/cache/apt/archives/

Post by mpack »

It doesn't matter whether or not the VDI is dynamic or static - it doesn't affect the capacity of the drive. You make host space available to the guest by choosing an appropriate capacity when the VDI is created. If the VDI is static then that capacity will be allocated immediately. If it's dynamic then the capacity will be allocated on demand. Under no circumstances will the drive ever receive more capacity than was specified at creation time.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: E: You have not enough free space /var/cache/apt/archives/

Post by socratis »

Dirk_Lehmann wrote:by the way, how to show / check this if this vdi is set to dynamic or static with the CLI command VBoxManage
  • VBoxManage showmediuminfo "<YourVDI>"
Example:
$ VBoxManage showmediuminfo "/Users/Shared/VirtualBox/Machines/Mint/Mint.vdi" 
UUID:           e1433d4a-7f87-4cf3-9b34-619da3641ca3
Parent UUID:    base
State:          created
Type:           normal (base)
Location:       /Users/Shared/VirtualBox/Machines/Mint/Mint.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       40960 MBytes
Size on disk:   7473 MBytes
Encryption:     disabled
In use by VMs:  Mint (UUID: 7076d675-33ea-4370-89a9-7877a428e77c) [5.1.26-2017.07.28 (UUID: 6d91ec54-fd76-434d-a008-f3c0adfaedb5)]
Child UUIDs:    e83a54cf-834b-4ed6-85dd-0e11139918b7
Dirk_Lehmann wrote:how to set guest system to use the free space of the host-system?
How to resize a Virtual Drive.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Dirk_Lehmann
Posts: 60
Joined: 4. Oct 2015, 22:27

Re: E: You have not enough free space /var/cache/apt/archives/

Post by Dirk_Lehmann »

So I understand that I have to allocate more disk space with CLI commands (the commands needed by the guest os for changing the size of logical volumen) in the guest now to use more of the dynamic availabe disc capacity for the VM, is that correct?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: E: You have not enough free space /var/cache/apt/archives/

Post by socratis »

I'm not even sure what the last question means. I suggest you read the manual on dynamic vs. fixed VDIs so we're all in the same page. You have to have a basic understanding of the terminology, before we can have a meaningful conversation...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Dirk_Lehmann
Posts: 60
Joined: 4. Oct 2015, 22:27

Re: E: You have not enough free space /var/cache/apt/archives/

Post by Dirk_Lehmann »

It doesn't matter whether or not the VDI is dynamic or static - it doesn't affect the capacity of the drive. You make host space available to the guest by choosing an appropriate capacity when the VDI is created. If the VDI is static then that capacity will be allocated immediately. If it's dynamic then the capacity will be allocated on demand. Under no circumstances will the drive ever receive more capacity than was specified at creation time.
Do I understand this right: I have now to change capacity of the drive at the guest OS to get new free disk space in the guest OS if my VDI is set to dynamic because guest OS still now only uses the appropriate capacity when the VDI was created? I am wondering if you might confirm.
Dirk_Lehmann
Posts: 60
Joined: 4. Oct 2015, 22:27

Re: E: You have not enough free space /var/cache/apt/archives/

Post by Dirk_Lehmann »

I'm not even sure what the last question means. I suggest you read the manual on dynamic vs. fixed VDIs so we're all in the same page. You have to have a basic understanding of the terminology, before we can have a meaningful conversation...
For more flexible storage management, use a dynamically allocated image. This will initially be very small and not occupy any space for unused virtual disk sectors, but will grow every time a disk sector is written to for the first time, until the drive reaches the maximum capacity chosen when the drive was created. While this format takes less space initially, the fact that VirtualBox needs to expand the image file consumes additional computing resources, so until the disk file size has stabilized, write operations may be slower than with fixed size disks. However, after a time the rate of growth will slow and the average penalty for write operations will be negligible.
Source: https://www.virtualbox.org/manual/ch05.html

So I have to use GParted for example or a other methode to change disk size of VM if VM is running out of free space, can you confirm?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: E: You have not enough free space /var/cache/apt/archives/

Post by socratis »

I will isolate the important part that you're missing:
Dirk_Lehmann wrote:until the drive reaches the maximum capacity chosen when the drive was created.
Yes, you have to resize your virtual hard disk. Yes you have to use GParted, or an equivalent tool.

Do you see the example of mine from before?
socratis wrote:
Format variant: dynamic default
Capacity:       40960 MBytes
Size on disk:   7473 MBytes
No matter what, my VDI will *not* grow over 40960 MB. The "dynamic" part refers to the fact that it occupies now 7473 MB. It does *not* mean that it will grow more than 40960 MB depending on the needs of my guest! Never!!!
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Dirk_Lehmann
Posts: 60
Joined: 4. Oct 2015, 22:27

Re: E: You have not enough free space /var/cache/apt/archives/

Post by Dirk_Lehmann »

Thank you!
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: E: You have not enough free space /var/cache/apt/archives/

Post by socratis »

@Dirk_Lehmann
Take also a look at "Supposedly "dynamic" vmdk file does not resize."
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Dirk_Lehmann
Posts: 60
Joined: 4. Oct 2015, 22:27

Re: E: You have not enough free space /var/cache/apt/archives/

Post by Dirk_Lehmann »

Am I right that I firstly have to remove all those snapshots of this vm bevore I am able to make a

Code: Select all

VBoxManage modifymedium --resize <megabytes>
Snapshots:
   Name: Sicherungspunkt 38 (UUID: 678d359a-bac4-450c-8dc6-a96877848174)
      Name: Sicherungspunkt 39 (UUID: 45395ac2-01f6-48a2-8351-7afa6e0905df)
         Name: Sicherungspunkt 40 (UUID: 0d2e5787-25f1-45fb-aa57-26259df4a331)
            Name: Sicherungspunkt 41 (UUID: da8d23f5-c22d-476e-81e7-75ae6de1c6ad)
            Name: snap1-before-upgrade (UUID: b830361b-b97a-4a52-a5ad-1d4eade073a9)
               Name: snap2-before-upgrade (UUID: 7f3ad778-685c-4fe4-96e5-15ed190e6f0b)
                  Name: snap3-before-upgrade (UUID: 8595df3b-7849-4922-8711-c5a51f5f80ff) *
I am also wondering why I can not figure out current size this way
dirk@ubuntu:~$ VBoxManage showmediuminfo disk "678d359a-bac4-450c-8dc6-a96877848174"
VBoxManage: error: The given path '678d359a-bac4-450c-8dc6-a96877848174' is not fully qualified
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp
dirk@ubuntu:~$ VBoxManage showmediuminfo "678d359a-bac4-450c-8dc6-a96877848174"
VBoxManage: error: The given path '678d359a-bac4-450c-8dc6-a96877848174' is not fully qualified
VBoxManage: error: Details: code VBOX_E_FILE_ERROR (0x80bb0004), component MediumWrap, interface IMedium, callee nsISupports
VBoxManage: error: Context: "OpenMedium(Bstr(pszFilenameOrUuid).raw(), enmDevType, enmAccessMode, fForceNewUuidOnOpen, pMedium.asOutParam())" at line 179 of file VBoxManageDisk.cpp
Maybe some syntax error in there?
Last edited by socratis on 15. May 2018, 07:31, edited 1 time in total.
Reason: Enclosed the information in [pre] tag for better readability
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: E: You have not enough free space /var/cache/apt/archives/

Post by socratis »

Dirk_Lehmann wrote:Am I right that I firstly have to remove all those snapshots of this vm
Yes. Otherwise if you enlarge your last snapshot only, and you revert to a previous snapshot, your virtual HD is going to be smaller. Always remove your snapshots, if you don't understand 110% how snapshots work.
Dirk_Lehmann wrote:Maybe some syntax error in there?
Absolutely! There is no file with that name, is it? Give it the correct file path and it will work. See my example for guidance.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Dirk_Lehmann
Posts: 60
Joined: 4. Oct 2015, 22:27

Re: E: You have not enough free space /var/cache/apt/archives/

Post by Dirk_Lehmann »

Got this result yet, but need the latest snapshot to be current for VBoxManage modifymedium /media/dirk/59b80d1c-3259-4cf7-b56e-0b24d55f1111/Webserver/Webserver.vdi --resize <megabytes>
dirk@ubuntu:~$ VBoxManage showmediuminfo /media/dirk/59b80d1c-3259-4cf7-b56e-0b24d55f1111/Webserver/Webserver.vdi 
UUID:           d99b561e-ec91-4b7d-8ea6-11b19c6eb22b
Parent UUID:    base
State:          locked read
Type:           normal (base)
Location:       /media/dirk/59b80d1c-3259-4cf7-b56e-0b24d55f1111/Webserver/Webserver.vdi
Storage format: VDI
Format variant: dynamic default
Capacity:       12288 MBytes
Size on disk:   5944 MBytes
Encryption:     disabled
In use by VMs:  Webserver (UUID: 59e4efc3-4866-4931-a560-928083685021) [Sicherungspunkt 38 (UUID: 678d359a-bac4-450c-8dc6-a96877848174)]
Child UUIDs:    e5a6f58a-448f-4388-92e2-02c5921c99d4
I am wondering if you might let me know in advance how to get the latest snapshot of this vm as current state for the vdi before I going to delete snapshots?
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: E: You have not enough free space /var/cache/apt/archives/

Post by socratis »

Wait a minute... You're sitting in front of your computer, and you want me to figure it out? :shock:
How about looking at it?

Are you running VirtualBox on a headless server? There's no VirtualBox Manager, CLI only?
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
towo2099
Volunteer
Posts: 362
Joined: 18. Aug 2014, 21:53
Primary OS: Debian Sid
VBox Version: PUEL
Guest OSses: Android, Linux

Re: E: You have not enough free space /var/cache/apt/archives/

Post by towo2099 »

Since the guest is using LVM, there is no need for resizing the vdi. Add a new vdi and use the powers of LVM to add space tu the guest system.
Locked