Posts

Showing posts with the label virtualization

Defragmentation and resizing to minimize HD size of a Virtual Machine Drive for Virtual Box

When creating a Virtual HD for Virtual Machine in Virtual Box, you can create a large disc space but the actual size on the disc can be much smaller until you fill it up. But after you fill it, and then delete and try to free space the size on the host disc still remain large. Here is how to resize the Virtual Drive HD on the host machine: You have to do the following steps: Run defrag in the guest (Windows only) Nullify free space: With a Linux Guest run this: dd if=/dev/zero of=/var/tmp/bigemptyfile bs=4096k ; rm /var/tmp/bigemptyfile Or: telinit 1 mount -o remount,ro /dev/sda1 zerofree -v /dev/sda1 With a Windows Guest, download SDelete from Sysinternals and run this: sdelete.exe c: -z (replace C: with the drive letter of the VDI) Shutdown the guest VM Now run VBoxManage's modifymedium command with the --compact option: With a Linux Host run this: vboxmanage modifymedium --compact /path/to/thedisk.vdi With a Windows Host run this: VBoxManage.exe modifymedium --compact c:\p...

שליטה ב - VirtualBox בשורת הפקודה ב - Linux

לתכנת VirtualBox המאפשרת וירטואליזציה של מערכות הפעלה ישנה אפשרות לשלוט במערכות הרצות מתוך ה - Command Line. דבר זה מאפשר להפעיל את מערכות ההפעלה ללא ממשק משתמש אמיתי, כלומר ללא GUI. כמו כן זה מאפשר הפעלה אוטומטית של מערכות וירטואליות. VBoxManage listvm מאפשר לקבל רשימה של מערכות וירטואליות VBoxManage startvm “Windows XP” יפעיל לנו את מערכת ההפעלה בשם Windows-XP VBoxManage startvm “Windows XP” --type=headless יפעיל את מערכת ההפעלה הוירטואלית ללא חלון GUI. VBoxManage controlvm “Windows XP” poweroff יכבה את מערכת ההפעלה הוירטואלית. לקריאה נוספת על VBoxManager VirtualBox Command Line