Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: HankBit on October 12, 2013, 10:02:51 PM



Title: VirtualBox and Bitcoin-QT
Post by: HankBit on October 12, 2013, 10:02:51 PM
Hi,
I've been quite successful maintaining several virtual machines, each machine has only one daemon/GUI/QT client.  Eg I have BTC-qt, PPC-qt, LTC-qt, etc, etc, I even have a Solid Coin Virtual machine!  11 in total.

I feel this is the most secure way to run multiple clients, provide security, and segregate them to avoid any viruses, etc.  Each VM runs Ubuntu linux 12.04 nowadays. 

Anyhow, I have been using a dynamically sized disk with a virtual size of 20GB, has been working great.  Until of course the BTC blockchain has now grown in size to require more.  In the past, I had researched how to increase the virtual disk, and my general conclusion (this dates back a couple years) was that this cannot be done without some severe trouble.  If anyone has tips on this, I am all ears!

But my main question is this.  I went ahead and created a new VM with a 200 GB disk, again dynamically sized.  I install the QT client, and have noticed that the VM disk grows to 60GB on my host machine (Windows 7) but the disk usage inside the client (Ubuntu 1204) is only using 12GB.  Problem here is I have 60GB left on the host machine and the VM stops when the host machine's disk is full (duh).

How do you explain the VM disk growing to 60GB when the client is only using 12GB?  My other BTC client that is filling up is 20GB in the client (Ubuntu) and is taking up 20GB in the host (Windows).  Makes perfect sense.

Why is my new VM taking up 12 GB on the client and 60 GB on the host?

Thanks in advance!!!



Title: Re: VirtualBox and Bitcoin-QT
Post by: K1773R on October 13, 2013, 03:13:49 AM
Hi,
I've been quite successful maintaining several virtual machines, each machine has only one daemon/GUI/QT client.  Eg I have BTC-qt, PPC-qt, LTC-qt, etc, etc, I even have a Solid Coin Virtual machine!  11 in total.

I feel this is the most secure way to run multiple clients, provide security, and segregate them to avoid any viruses, etc.  Each VM runs Ubuntu linux 12.04 nowadays. 

Anyhow, I have been using a dynamically sized disk with a virtual size of 20GB, has been working great.  Until of course the BTC blockchain has now grown in size to require more.  In the past, I had researched how to increase the virtual disk, and my general conclusion (this dates back a couple years) was that this cannot be done without some severe trouble.  If anyone has tips on this, I am all ears!

But my main question is this.  I went ahead and created a new VM with a 200 GB disk, again dynamically sized.  I install the QT client, and have noticed that the VM disk grows to 60GB on my host machine (Windows 7) but the disk usage inside the client (Ubuntu 1204) is only using 12GB.  Problem here is I have 60GB left on the host machine and the VM stops when the host machine's disk is full (duh).

How do you explain the VM disk growing to 60GB when the client is only using 12GB?  My other BTC client that is filling up is 20GB in the client (Ubuntu) and is taking up 20GB in the host (Windows).  Makes perfect sense.

Why is my new VM taking up 12 GB on the client and 60 GB on the host?

Thanks in advance!!!



if you download a blockchain of 8GB, your disk image will be 8GB bigger. if you delete the blockchain, the disk image will stay the same big and your guest will say its 8GB less. what virtualbox does is simple. guest wants to write to offset X but image isnt big enough so expand image a bit and map it to offset X. it isnt aware if you delete something inside your guest as it isnt working on a filesystem level.


Title: Re: VirtualBox and Bitcoin-QT
Post by: HankBit on October 13, 2013, 02:07:33 PM
Thanks for the response.  But all of my other/previous images dont exhibit this behavior.  If I understand what your saying, it would mean the bitcoin client occasionally takes the blockchain (eg 10GB) and copies it (consuming 20GB) and then deletes the original blockchain.  Thats the only way to explain the consumption of host disk.

The one difference between my current and former BTC VMs is the QT client is now 0.8.5.  Does the new client do something different in this regard?  Is there something I can configure to change this behavior?


Title: Re: VirtualBox and Bitcoin-QT
Post by: grue on October 13, 2013, 03:17:25 PM
But my main question is this.  I went ahead and created a new VM with a 200 GB disk, again dynamically sized.  I install the QT client, and have noticed that the VM disk grows to 60GB on my host machine (Windows 7) but the disk usage inside the client (Ubuntu 1204) is only using 12GB.  Problem here is I have 60GB left on the host machine and the VM stops when the host machine's disk is full (duh).

How do you explain the VM disk growing to 60GB when the client is only using 12GB?  My other BTC client that is filling up is 20GB in the client (Ubuntu) and is taking up 20GB in the host (Windows).  Makes perfect sense.

Why is my new VM taking up 12 GB on the client and 60 GB on the host?
this looks like a problem with virtualbox, not bitcoin-qt. try asking in their support forum instead. :)


Title: Re: VirtualBox and Bitcoin-QT
Post by: wiggi on October 13, 2013, 04:24:18 PM
It's normal that after alot of usage and many VirtualBox version updates things go a bit     
out of whack. For example, in a 50GB dynamically sized VM I have:

.bitcoin/blocks      totalling 23.8 GB
.bitcoin/chainstate  totalling 2.1 GB
.bitcoin             totalling 34.7 GB

Perhaps fixed-size disk is the better option.


Title: Re: VirtualBox and Bitcoin-QT
Post by: deepceleron on October 14, 2013, 01:05:13 AM

Why is my new VM taking up 12 GB on the client and 60 GB on the host?

Thanks in advance!!!

Virtualbox doesn't necessarily know how to free up previously used space. Even if you have emptied your recycle bin and such, previously used freed areas of the disk may still have data.

Essentially, you need to defrag the disk in the guest OS and write 0s to the free space. Then close the VM and compact the virtual drive.

http://dantwining.co.uk/2011/07/18/how-to-shrink-a-dynamically-expanding-guest-virtualbox-image/


Title: Re: VirtualBox and Bitcoin-QT
Post by: bee7 on October 14, 2013, 01:24:21 AM
May be it's worth to run these daemons in chrooted jails? I mean that running them each in a separate VM is a kind of overkill, IMHO.


Title: Re: VirtualBox and Bitcoin-QT
Post by: Pinwheel on October 14, 2013, 01:49:05 AM
why not just make new VM like 40gb size and move content there.


Title: Re: VirtualBox and Bitcoin-QT
Post by: deslok on October 15, 2013, 02:11:49 PM
if you can moving to vmware will solve some of your issues, we can increase disc size of an existing virtual drive dynamically(and add memory on esx) if you're running all of these on their own box ESX is free to use and a lot more powerful than VirtualBox