Showing posts with label virtualbox. Show all posts
Showing posts with label virtualbox. Show all posts

Thursday, February 12, 2026

Windows VM notes.

 Despite how much you dislike Windows, especially Windows 11, there are still times which you can't escape from it.  Like many people, I have a virtualbox VM for it, and here are few things I would do to make it "better".

 1) Debloating.  It is not a secret Windows 11 is not lean even with a fresh installed.  Especially if you are unfrotunately having the joy of using its Home edition.  So, the first thing you may want to do is to trim it down.  Win11Debloat may be a good start.

 https://github.com/Raphire/Win11Debloat

 

 

 

 



2) Compact the VDI image. There are times you either just want to keep the VDI file size in control or you want to export the VM as OVA for backup. For both instance, you may want o compact your VDI first. Here are steps I would take.

a) run Windows' Cleaner tool to delete any obsolete/residue files left from Windows updates.

b) run sdelete to "zero" the empty spaces after the deletion in (a)

sdelete c: /z
sdelete is a power toy tool that can be obtained at: https://learn.microsoft.com/en-us/sysinternals/downloads/sdelete

c) run the Windows defrag tool to defragment the drive, so all empty spaces are in continuous blockss.

d) optional. I often run the (b) again, to zero the empty space once more before the compacting.

e) shutdown the VM, and run the below command on the host machine to the VDI file to compact the file.

 vboxmanage modifyhd <your vdi file> --compact 

 If you get the erorr below, try switch to cmd and try again.

  


 

Saturday, May 13, 2023

Create a Ventoy Disk Image using VirtualBox

There are already many tutorials available on the Internet for preparing a Ventoy USB stick, so how is it different this time?  Rather than answer this question, let me tell you the story behind this post.

A friend of mine called me one day and asked me to help him to reinstall Windows.  This should be easy if you have another Window machine available.  Unfortunately, the another machine he has is a Mac.  As you may already know, it is not simple to prepare a USB Window boot disk on a Mac, especially if you need to do it remotely (in this case, my friend is actually in another country) and the person you are helpful is not computer literate at all.

To cut a long story short, at the end I created a basic Ventoy installed USB drive, converted it into an image file, zipped it , sent the compressed image over the Internet to his Mac, and finally wrote it to a physical USB drive using Etcher.

Although this process works, it is some how convoluted and difficult to execute.  For instance, an image extracted from a 16GB drive may not fit another 16GB drive from another brand.  In fact, this was the problem I had.

Anyway, since then I have found a quicker way to get the image, and hence having this blog to share it with you.

Here are the steps I took for creating a basic Ventoy disk image.

1) Download a copy of the Ventoy Live CD ISO from Ventoy site (https://www.ventoy.net/en/download.html)

2) Prepare a basic virtual machine on Virtual Box.  The setting I was using are:





Ensure EFI support is required


Create a virtual machine with NO disk attached at the stage!


3) Create a virtual disk image and attached it to the USB controller of your virtual machine.  As mentioned before, a 16GB drive image may not be able to write to another branded drive with the same capacity, hence I would suggest you to create your image that is 2GB smaller than your target drive.  For example, if your drive is 16GB, then the image size should be 14GB.









As you can see, a 16GB does not have all its 16GB available to you.  Hence, it is safer to set the virtual disk size approx. 2GB less than the target drive capacity.


4) Start the VM, and follow the on screen instructions to install Ventoy onto the virtual USB drive you created in (3)



5) Turn off the virtual machine, and then open the folder where your VM files are stored by right click your VM, and select "Show In File Manager".




6) Open a command prompt, and then use the vboxmanage tool to convert the vdi to a disk image.  The command is:-

VBoxManage clonemedium --format RAW ventoy_1.vdi ventoy.img




If you are using Windows, vboxmanage may not be available under PowerShell.  In this case, type, cmd to change to CMD prompt, and try the vboxmanage command again.


7) Write the image file (ventoy.img) with your favorite imaging utility such as Etcher to a USB drive.






If you are in the similar situation like myself, who needs to write the image on a remote machine, then you may want to compress the image file before sending it over the Internet.  Since the image file is from an empty drive, the compressed file should be very compact.  In my case, it is merely 33MB which much more Internet friendly.

You may ask why didn't I do all of these on my friend's machine.  The answer is permissions.  It is often that the default VirtualBox installation needs further permissions tweaks before it can fully access the local resources.  Trying to fix the permissions with a non technical person remotely, it is challenging at best if not impossible.



Saturday, August 4, 2012

Kubuntu and VirtualBox

I have hold back the upgrade from 11.10 to 12.04 as I have learnt my lessons not to upgrade to the latest as soon as it arrives as it is better to wait a while for all the initial teething problems getting fixed.

And 11.10 is working fine for me, well on my netbook anyway.  I know it is running the same Linux under the hood, but Kubuntu seems to handle power management a lot better.  At least my netbook won't put into sleep whenever I pull the power plug.

Anyway, the urge for me to upgrade to 12.04 is VirtualBox.  11.10 is just painfully slow running on VirtualBox.  Hence, I decided to upgrade to the newer version to see if it helps.  Gladly, it seems to work better.  At least I don't need to wait for a minutes for responses.

Update: The latest version of VirtualBox 4.2 seems to fixed the performance issue.  In fact, the new version has improved the speed across the board.

Friday, December 24, 2010

VirtualBox and D3D

I have been working with VirtualBox for a while now. Until today, I assumed D3D is enable as I had ticked the box for D3D support while I was installing the Guest software. However today when I was upgrading my VirtualBox to 4.0, I came across this error message said I couldn't enable D3D supports as I weren't in Windows Safe Mode. After Google this error, I now realize that in order to get D3D to work, I have to install the Guest under Windows Safe Mode. VirtualBox is a great free virtualization solution, however, I am surprised it take this long to include this little error message ... (okay, I admit didn't read the full manual) ...

Friday, October 1, 2010

VirtualBox Life Saver

I recently had problem with my OS and had to reinstall the OS from scratch. This caused big problem with my VirtualBox setup as it had serious problem to attach my images as they all had snapshot attached to them. After searching Google, I found this nice little life saver called CloneVDI tool, which allows you to detach an image from its snapshot (at least this was what I did) Okay, I had lost something, but at least I don't need to rebuild everything from scratch. If you are in the similar situation as me, you may want to give this little tool a trial too!

http://forums.virtualbox.org/viewtopic.php?f=6&t=22422

Thursday, March 25, 2010

VirtualBox USB and Ubuntu

I finally manage to get the USB working inside VirtualBox. I followed the instructions from this site https://help.ubuntu.com/community/VirtualBox/USB, restarted my machine, and like magics, my USB works inside my guest system now!

Sunday, December 20, 2009

Virtualbox 3.1.2

VirtualBox is great utility, however, it isn't perfect. One of the annoying problems is its networking. If you are using desktop, it isn't much a problem. However, if you are using laptop, VirtualBox's NAT implementation seems to fail if you switch between networking connectors, which is very common in laptop. For instance, I may move from my WiFi connection to cable connection. This would result lost connection to my Guest System.

With the new version, I can at least regain the connection by change the connection from NAT -> Bridge and back to NAT again as I can dynamically change my connectiont type in the new version. It isn't perfect, but it gets the job done.

I have tried various virtualization solution, and VirtualBox is still my favorite due to its wide range of supported formats, and its speed. While we are talking about speed, the latest version finally fixed the Hardware Virtualization support on my VIA chipset motherboard. Previously, it would caused BSOD, but now, it works perfectly! Hurray!

Wednesday, October 28, 2009

Create split virtual HD for VirtualBox

VirtualBox is a great tool and I like it a lot.  However, the inability of creating split virtual  hard drive into 2GB chunks can be a problem at times.  Most flash pen drives use FAT32 to maximize its compatibility with different OSes, but at the same time this limits the maximum file size to 2GB.  The inability of spliting virtual drive into 2GB blocks makes transporting  native VDI image files used by  VirtualBox impossible.  However, there is a workaround as VirtualBox is also compatible with images created by VMWare which allows split images.

Today, I found this website which allow people to create empty VMware compatble images without using a VMWare product.

http://www.easyvmx.com/new-easyvmx.shtml

With the help of this link, you can now create virtual machines with split file feature under VirtualBox.

Sunday, March 1, 2009

Linux auto screen resize in VirtualBox

I have been using Virtualbox for a while now and I really like it. I always use the latest version if I can so I can get the latest fix and featuress. After I had just upgraded from 2.1.2 to 2.1.4, I noticed my auto resize in my Ubuntu Linux stopped working. I thought this might be caused by the incorrect driver module, hence I had recompiled the add-on again. It is only after the third time I noticed that there was an error message said that if my xorg.conf file contains modeline settings, the auto resize will stop working. Well, just in case you are like me who has not noticed that warning. To get the auto resize to work, simple remove any modeline from the xorg.conf and restart the window manager, everything should works again!.

Sunday, September 21, 2008

VirtualBox and Simultanenous Guests

I have been using VirtualBox for a while now, and I like it a lot. Especially when I need to run two guests OS simultaneously. With VMWare player or server, it would bring my system to its knees. However, on the same machine, I can use two guest OSes in parallel without a problem on VirtaulBox. So, if you like me, need to run multiple guest OSes simultaneously, you may want to give VirtualBox a trial.

Thursday, September 18, 2008

VirtualBox on performance

I know virtualization with VMWare Player on a slow machine is a pain. I was a bit curious about how VirtualBox flares. I loaded it on my AMD Sempron 2400+ machine, and run a copy of Windows Vista Business Edition on a Windows XP host. To my surprise, it runs very well. Okay, I am not running anything heavy. Vista only configure with bare minimum software. The machine ran as it was natively. In fact, it even runs better than my work machine (P4 2.8GHz, 2GB memory) with Windows XP on it (it loaded with all these craps insisted by C&IT service). I am very please with VirtualBox experience. VMWare may work better if it got hardware support, otherwise, to me, it seems VirtualBox performs better with "normal" machines. By the way, I am a fan of AMD processors, as Windows runs much more smoother on them (I know, Intel processors are faster, but I can swear, Windows runs much more smoother on AMD processors, i.e. less lags)

Tuesday, September 16, 2008

VirtualBox

I am a big fan of virtualization lately as I have been involved in several development projects and they all need different setup. Instead of loading my system with all these "only use once" or very unwelcome software (e.g. Visual Studio 2008), I installed them into different copies of virtual machines. This allows me to work on clean copies of Windows with only necessary software. Once I finished with them, I simply delete the guest OS image. Very neat.


Until few days ago, I was using VMWare Server as my virtualization platform. Then, I found out VirtualBox from Sun MicroSystem. Now I have been using both of them, I must say for user point of view, there is very little difference between them. What made me move initially was the support of hardware virutlization support, namely Intel VT-x and AMD-V technologies. However, it turns out it does more damages than helping. With VT-x switched on, VirtualBox would crash. It seems the implementation of AMD-V is a bit better. VirtualBox runs perfectly there, but very slow in comparison to VMWare Server I was using. After a quick search on Google, it seems with VirtualBox, enabling hardware support will actual decrease the performance. It is very sad as I really would like to have hardware assisted VM. I don't like the idea of having software emulating function while dedicate hardware supposedly can do it.


Anyway, putting performance issue and buggy VM hardware supports aside, VirtualBox is quite stable and pleasant to use. Especially if you need to run multi guest instances at the same time, it seem to handle better than VMWare Server.