How I Run VirtualBox 4.3.22 with Lighthouse 64 Puppy Linux as Both Host and Guest |
Thursday, November 23rd, 2017 11:52:35 GMT |
Programming |
Last modified Nov. 26, 2017, 8:28 AM EST.
I've been using Lighthouse 64 Puppy Linux 6.02 Beta 2 as both my non-virtual host system, and as my virtual guest system.
This blog post contains notes on how I got that working nicely. I did all this stuff mostly manually, but perhaps someday I'll figure out how to automate a lot of the below.
End of additions.)
Unfortunately, certain computers run GNU/Linux guests terribly slowly. One of them is my HP Compaq dc7700 Convertible Minitower desktop. (Surprisingly, Windows XP guests run quite well on it.)
I was never able to figure out how to fix that.
I don't know why they work so much better, but I guess they're probably both newer than my HP Compaq dc7700.
(Addition, Jan. 9, 2018, 10:54 AM EST. This section is now out of date.
Instead of using symlinks to keep some of my VirtualBox settings in the ramdisk and some of them on a physical disk - I now prefer to keep all of my VirtualBox settings in the ramdisk, and I use Ramize-Physave to occasionally save some of them to a physical disk.
End of addition.)
Contains stuff related to specific virtual machines.
You can actually choose whatever other path you want just by going to VirtualBox's File menu, choosing Preferences, and editing the "Default Machine Folder" in the "General" section.
But rather than change the path via VirtualBox's settings, I preferred to just copy that folder onto a physical disk, and put a symlink at
Then, inside the new location, I made the Snapshots folder into a symlink pointing to a folder somewhere in my RAM disk, to make it so saving and loading system snapshots will be faster. And any particularly useful snapshots I create, I manually save to a physical disk.
Contains quite boring-looking stuff, but I guess it's probably useful somehow.
I didn't do much with this folder - just copied it to a physical disk, and put a symlink at
I started out by making a new virtual machine with no hard disk, and told VirtualBox the machine's "Type" was Linux, and "Version" was "Other Linux (64-bit)".
(I prefer to use VirtualBox shared folders rather than a virtual hard disk, so I won't be stuck having to use VirtualBox or any other fancy tricks to access whatever files I have inside a virtual hard disk file.)
I set Shared Clipboard to Bidirectional.
And I set Drag'n'Drop to "Host to Guest", since nothing else works, except disabling drag and drop.
But, if I ever do want to use 2 monitors - in the Video settings, I can set "Monitor Count" to 2. (However, multiple monitors is another feature that doesn't start working until you install VirtualBox Guest Additions inside the guest system.) And while running my guest system, I can disable mouse integration via the Machine menu, and avoid seamless mode.
And here's the command I used to make my virtual right monitor act like it's below my virtual left monitor:
And I put a check in the box next to "Enable 3D Acceleration".
(I did that because the only part of my Puppy Linux Setup Kit which requires internet access is the downloader scripts, and I'm not working on those yet.)
I created 8 virtual optical disc drives - probably more than I'll need.
(Actually, I used an ISO I slightly modified, but I haven't released that, one reason being because I haven't used it enough yet to know if my modifications caused any serious glitches or not.)
(This is necessary because the VirtualBox Guest Additions installer won't work unless the DevX SFS file is mounted inside the guest system. And my guest system can't download the DevX from the internet because I removed my guest system's internet access.)
The -o option specifies the filepath where the ISO file will be output to.
The "DevX" text at the end of the command line refers to the "DevX" folder which I wanted mkisofs to put into an ISO file.
Shared folders can't be mounted and accessed until you install VirtualBox Guest Additions inside the virtual system.
In the "Folder Name" field for each shared folder, I put descriptive names like "ReadOnly-LegacySetupKit" and "ReadOnly-RenovSetupKit".
(Warning: Possibly Dangerous)
I read here that "Symbolic link creation from within a guest has been disabled in VirtualBox 4.1.8 for security reasons."
However, anytime I've run a Puppy Linux guest system, symlinks located in shared folders and pointing to files in the host system usually appear to be broken. Or, if the guest system actually contains a file or folder at the symlink's destination path, the guest system interprets the symlink to be referring to that guest system file or folder, and it can't access the host system's file or folder through that symlink.
So, I'm not sure there's a security issue here with Puppy Linux guests, though I easily could be wrong.
But, if my Windows XP guest had been capable of creating its own symlinks in shared folders, I'm guessing it probably would have been able to have access to probably any file at all in my host Puppy Linux system, which could have been quite bad, if my Windows XP guest was infected with malware.
I learned how to do it from this page's comment #14.
I wasn't able to enable symlink creation in every shared folder all at once. Instead, I have to enable symlink creation for each individual shared folder I want my guest system to be able to create symlinks in.
Which wasn't that much of a nuisance, since I only have 2 writable shared folders.
Please only use these commands at your own risk, because maybe there are worse security problems than I think.
Actually, my shared folders aren't named "Physical_Disk" and "RAM_Disk", but I renamed them here for clarity's sake.
To use the above command lines, you'll need to change those names to whatever your shared folders' names are - whatever label you put in the "Folder Name" section of their settings.
Also, you'll need to change "APSK" (the name of my virtual machine) to the name of your virtual machine.
You don't need to restart the entire VirtualBox program for the new settings to take effect, but if your virtual machine is running, you'll have to turn it off and on again. The new settings should start working right away, even if you restore a system snapshot instead of rebooting without a snapshot.
I don't know why this happens: "Installing graphics libraries and desktop services components ...fail!"
But, it seems to work fine for me anyway.
Those features will go away the next time you restart the X server.
If you want to keep those features enabled, you can add the above command lines to the file
(Here's the forum thread where I learned about the above command lines and the idea of adding them to .xinitrc.)
To choose how you want the shared clipboard to behave (bidirectional, guest to host, host to guest, or disabled), go to VirtualBox's Devices menu, then its Shared Clipboard submenu.
To choose how you want the drag and drop feature to behave (bidirectional, guest to host, host to guest, or disabled), go to VirtualBox's Devices menu, then its Drag'n'Drop submenu.
Sometimes you have to fiddle with the guest windows and/or switch out of Seamless mode and get back into it to make everything display properly.
To my surprise, it is possible to add new shared folders while the virtual machine is running - either permanent folders (which you can make by putting a check in the box next to "Make Permanent") which will go in the "Machine Folders" list permanently, or "Transient Folders".
Here's a command line I used to make an empty folder. (But you can create the empty folder any way you want, even using a graphical file manager.)
You can find out the "Folder Name" by going to the "Shared Folders" section of the virtual machine's settings, which you can view and edit even while the virtual machine is running.
The name you put after "vboxsf" should be your shared folder's "Folder Name", and the folderpath after that should be the folderpath (located inside your guest system) which you want to use as a mountpoint for that shared folder.
But, when you go to the folder you specified, you'll hopefully see the external files you were expecting to see.
You can open that folder from a console with command line like this:
VirtualBox's Snapshot feature makes it possible for me to easily test my Puppy Linux Setup Kit repeatedly on a fresh, mostly pristine, almost default system, without having to repeatedly reboot a real computer and/or go through the somewhat slow Puppy Linux startup process.
Instead, I can just shut down my virtual system and restore a snapshot in about 10 seconds. (I assume the fact that I keep snapshots in my RAM disk makes them save and load faster.)
After about 15 seconds, that resulted in a large snapshot file around 1 GB.
Then I relaunch my virtual machine, and after about 10 seconds, my snapshot is restored. (I assume the fact that I keep snapshots in my RAM disk makes them save and load faster.)
But, that will probably soon change, and I think this new way of doing things will hopefully enable me to make a lot more progress much faster, assuming my health continues to improve.
Recently, I started using VirtualBox 4.3.22 to help me update, refine, and test my Puppy Linux Setup Kit without having to repeatedly reboot a real computer.
(Additions, Jan. 9, 2018, 10:47 AM/9:03 PM EST. I finally made some scripts which automate some of the below:
Thanks to everyone who put up useful info on the web that helped me figure out how to do all this!
Some Computers Work Better Than Others
For Running GNU/Linux Guests in VirtualBox
But, luckily, other computers, such as my Toughbook CF-C1 laptops, and my giant cheese grater-like Mac Pro from 2008, run GNU/Linux guests at quite acceptable speeds - though noticeably slower than non-virtual GNU/Linux.
How I Store My VirtualBox Settings
I like to keep some of my VirtualBox settings on a physical disk, and some in the RAM disk. I accomplish this via symlinks.
On my system, VirtualBox creates two different settings folders:
/root/VirtualBox VMs
/root/VirtualBox VMs
pointing to the new location.
/root/.config/VirtualBox
/root/.config/VirtualBox
pointing to the new location.
Settings for My Virtual Machine
Virtual Disc Drives and Discs for My Virtual Machine
You can get an official Lighthouse 64 Puppy Linux 6.02 Beta 2 ISO from:
The official DevX SFS file for Lighthouse 64 Puppy Linux 6.02 Beta 2 can be downloaded from this page:
To put the DevX file into my own custom ISO file, I put the DevX file in a folder named "DevX", and ran this command line, with my console's working directory set to the folder containing the "DevX" folder:
The -V option sets the disc's name (which will be visible on the desktop of the virtual Puppy) to "DevX".
Settings for Shared Folders for My Virtual Machine
Making It Possible For the Guest System to Create Symlinks Inside a Shared Folder
Things are very different with a Puppy Linux host and a Windows XP guest. With VirtualBox 4.1.8, a Lucid Puppy Linux 5.2.8 version 004 host and a Windows XP guest, any symlinks located in a shared folder and pointing to files or folders in the host system make those files and folders totally accessible to the Windows XP guest! Which was actually useful to me back in the days when my primary use for VirtualBox was to use Astroblahhh Desktop in a Windows XP guest.
Anyway, since I usually don't let my Puppy Linux guests have internet access, and I sometimes need to be able to create symlinks in shared folders, and symlinks in shared folders maybe aren't as dangerous with a Puppy Linux guest as they definitely are with a Windows XP guest, I was willing to take the risk that there might actually be major security problems with enabling my Puppy Linux guest to create symlinks in shared folders.
So, in my host system's console, I ran these two command lines.
How to Install VirtualBox Guest Additions Inside the Guest System
/media/VBOXADDITIONS_4.3.22_98236
in the title), press the ~ key on your keyboard. (This will open a console with its working directory set to this folder.)
./VBoxLinuxAdditions.run
/root/.xinitrc
, so they'll get run automatically every time the X server is restarted.
Mounting Shared Folders
Creating and Restoring a VirtualBox Snapshot
So far, I've actually spent more time on this blog post than actually working on my Puppy Linux Setup Kit with the help of VirtualBox.