I have an Ubuntu Server 10.04 VPS (Virtual Private Server) that hosts my website. I would like to clone this VPS and create a VirtualBox machine from it. How can I do this?
I think you want to look at the command
VBoxManage convertfromraw or
VBoxManage clonehd. I can't remember exactly how to do it, but I found these two guides: http://www.virtualbox.org/wiki/Migrate_Windows and http://www.pendrivelinux.com/boot-a-usb-flash-drive-in-virtualbox/.
Once you have the hard drive converted, you can just create a new Virtual Machine, but use your existing disk image you just created.
If you just want to reproduce the settings of an existing installation: install a basic system from scratch, then run
aptitude-create-state-bundle on the VPS to export your package selection and APT settings, and run
aptitude-run-state-bundle to import these settings into the VirtualBox installation (and in particular get the same set of packages installed). Then migrate your customizations:
/etc (where you'll have to change a few files),
/var/www or wherever you keep your web server data. See also How do I migrate configuration between computers with different hardware?. See also a step-by-step cloning guide, which addresses what files you'll most likely need to change in