VM Image Creation Guide for Nanite
This document provides a comprehensive guide for creating VMware and VirtualBox virtual machine images for the Nanite Linux distribution. These VM images will allow users to quickly deploy and test Nanite without having to perform a full installation.
Prerequisites
Before creating VM images, ensure you have:
- A successfully built and tested Nanite ISO image
- Sufficient disk space (at least 40GB free)
- VMware Workstation/Player and/or VirtualBox installed
- Basic familiarity with virtual machine operations
General Approach
The process for creating VM images involves:
- Installing Nanite in a virtual machine
- Configuring the installed system for optimal VM performance
- Cleaning up the system to reduce image size
- Exporting the VM in the appropriate format
Creating a VirtualBox Image
Step 1: Set Up a New Virtual Machine
# Create a new virtual machine
VBoxManage createvm --name "Nanite" --ostype Debian_64 --register
# Configure VM resources (adjust based on target audience)
VBoxManage modifyvm "Nanite" --memory 4096 --cpus 2 --vram 128 --graphicscontroller vmsvga
VBoxManage modifyvm "Nanite" --accelerate3d on --clipboard bidirectional --draganddrop bidirectional
# Create and attach a virtual hard disk (20GB)
VBoxManage createhd --filename "Nanite.vdi" --size 20480
# Set up storage controllers
VBoxManage storagectl "Nanite" --name "SATA Controller" --add sata --controller IntelAHCI
VBoxManage storageattach "Nanite" --storagectl "SATA Controller" --port 0 --device 0 --type hdd --medium "Nanite.vdi"
VBoxManage storagectl "Nanite" --name "IDE Controller" --add ide
VBoxManage storageattach "Nanite" --storagectl "IDE Controller" --port 0 --device 0 --type dvddrive --medium /path/to/nanite-ai-linux.iso
# Configure network
VBoxManage modifyvm "Nanite" --nic1 natStep 2: Install Nanite
# Start the VM
VBoxManage startvm "Nanite"During the installation process:
- Boot from the ISO and select “Install Nanite”
- Follow the installation wizard
- When prompted for partitioning, use the entire disk
- Install GRUB to the MBR
- Complete the installation and reboot
Step 3: Post-Installation Configuration
After installation, log in to the system and perform these optimizations:
# Update the system
sudo apt update
sudo apt upgrade -y
# Install VirtualBox Guest Additions
sudo apt install -y virtualbox-guest-utils virtualbox-guest-x11
# Configure for VM environment
sudo systemctl enable vboxadd-service
sudo systemctl start vboxadd-service
# Optimize for VM use
sudo apt install -y haveged
sudo systemctl enable havegedStep 4: System Cleanup
Before exporting, clean up the system to reduce image size:
# Remove installation logs and temporary files
sudo apt clean
sudo apt autoremove -y
sudo rm -rf /var/log/*.log /var/log/*/*.log
sudo rm -rf /var/cache/apt/*
sudo rm -rf /tmp/*
# Clear bash history
cat /dev/null > ~/.bash_history
history -c
# Shutdown the VM
sudo shutdown -h nowStep 5: Export VirtualBox Image
With the VM shut down, export it to a distributable format:
# Compact the VDI to reduce size
VBoxManage modifymedium disk "Nanite.vdi" --compact
# Export to OVA format (most portable)
VBoxManage export "Nanite" --output "Nanite-VirtualBox.ova" --ovf20 --manifestCreating a VMware Image
Step 1: Set Up a New Virtual Machine
Using VMware Workstation/Player:
- Select “Create a New Virtual Machine”
- Choose “Custom (advanced)” setup
- Select “I will install the operating system later”
- Select “Linux” as the guest OS and “Debian 64-bit” as the version
- Name the VM “Nanite”
- Allocate 4GB RAM and 2 CPU cores
- Create a new virtual disk (20GB, single file)
- Customize hardware:
- Add the Nanite ISO to the CD/DVD drive
- Enable 3D acceleration if available
- Configure network as NAT
Step 2: Install Nanite
- Start the VM
- Boot from the ISO and select “Install Nanite”
- Follow the installation wizard
- When prompted for partitioning, use the entire disk
- Install GRUB to the MBR
- Complete the installation and reboot
Step 3: Post-Installation Configuration
After installation, log in to the system and perform these optimizations:
# Update the system
sudo apt update
sudo apt upgrade -y
# Install VMware Tools
sudo apt install -y open-vm-tools open-vm-tools-desktop
# Configure for VM environment
sudo systemctl enable open-vm-tools
sudo systemctl start open-vm-tools
# Optimize for VM use
sudo apt install -y haveged
sudo systemctl enable havegedStep 4: System Cleanup
Before exporting, clean up the system to reduce image size:
# Remove installation logs and temporary files
sudo apt clean
sudo apt autoremove -y
sudo rm -rf /var/log/*.log /var/log/*/*.log
sudo rm -rf /var/cache/apt/*
sudo rm -rf /tmp/*
# Clear bash history
cat /dev/null > ~/.bash_history
history -c
# Shutdown the VM
sudo shutdown -h nowStep 5: Export VMware Image
With the VM shut down, export it to a distributable format:
- In VMware, select the VM
- Go to File > Export to OVF
- Name the export “Nanite-VMware”
- Select a destination folder
- Click “Save” to export
Alternatively, use the command line:
# For VMware Workstation
"C:\Program Files (x86)\VMware\VMware Workstation\OVFTool\ovftool.exe" "path\to\Nanite.vmx" "Nanite-VMware.ova"
# For VMware Player on Linux
ovftool /path/to/Nanite.vmx Nanite-VMware.ovaOptimizing VM Images
To ensure the best user experience, consider these optimizations:
Performance Optimizations
# Disable unnecessary services
sudo systemctl disable bluetooth.service
sudo systemctl disable cups.service
sudo systemctl disable avahi-daemon.service
# Configure swappiness for better VM performance
echo "vm.swappiness=10" | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
# Optimize filesystem for SSD
sudo sed -i 's/errors=remount-ro/errors=remount-ro,noatime,nodiratime/' /etc/fstabAI Component Optimizations
# Ensure AI services start automatically
sudo systemctl enable ollama.service
sudo systemctl enable nanite-assistant.service
# Pre-download smaller models for immediate use
ollama pull phi3:miniUser Experience Enhancements
# Create a welcome screen
cat > /etc/profile.d/nanite-welcome.sh << EOF
#!/bin/bash
echo "Welcome to Nanite VM!"
echo "This virtual machine contains a complete Nanite AI Linux environment."
echo "AI services are pre-configured and ready to use."
echo ""
echo "For help, type: less /usr/share/doc/nanite/README.md"
EOF
chmod +x /etc/profile.d/nanite-welcome.sh
# Add desktop shortcuts for common AI tools
mkdir -p /etc/skel/Desktop
cp /usr/share/applications/nanite-assistant.desktop /etc/skel/Desktop/
cp /usr/share/applications/nanite-image-generator.desktop /etc/skel/Desktop/
chmod +x /etc/skel/Desktop/*.desktopTesting VM Images
Before distribution, thoroughly test both VM images:
VirtualBox Image Testing
-
Import the OVA file:
VBoxManage import Nanite-VirtualBox.ova -
Start the imported VM:
VBoxManage startvm "Nanite" -
Test the following:
- System boots properly
- Desktop environment loads correctly
- Guest additions work (screen resizing, clipboard sharing)
- AI components function as expected
- Performance is acceptable
VMware Image Testing
- Import the OVA file in VMware Workstation/Player
- Start the imported VM
- Test the following:
- System boots properly
- Desktop environment loads correctly
- VMware Tools work (screen resizing, clipboard sharing)
- AI components function as expected
- Performance is acceptable
Troubleshooting Common Issues
Boot Issues
If the VM fails to boot:
- Check boot order in VM settings
- Verify GRUB installation
- Try repair mode from the Nanite ISO
Guest Additions/Tools Issues
If guest additions/tools aren’t working:
# For VirtualBox
sudo apt reinstall virtualbox-guest-utils virtualbox-guest-x11
sudo reboot
# For VMware
sudo apt reinstall open-vm-tools open-vm-tools-desktop
sudo rebootAI Component Issues
If AI components aren’t working:
# Check service status
systemctl status ollama
systemctl status nanite-assistant
# Restart services
sudo systemctl restart ollama
sudo systemctl restart nanite-assistant
# Verify model availability
ollama listFinalizing VM Images for Distribution
Before distributing the VM images:
-
Create documentation files:
# Create README file cat > Nanite-VM-README.md << EOF # Nanite Virtual Machine Images This package contains virtual machine images for Nanite AI Linux. ## System Requirements - 4GB RAM minimum (8GB+ recommended) - 20GB free disk space - 64-bit processor with virtualization support - VMware Workstation/Player or VirtualBox ## Installation ### VirtualBox 1. Open VirtualBox 2. Go to File > Import Appliance 3. Select the Nanite-VirtualBox.ova file 4. Follow the import wizard ### VMware 1. Open VMware Workstation/Player 2. Go to File > Open 3. Select the Nanite-VMware.ova file 4. Follow the import wizard ## Default Credentials Username: nanite Password: nanite ## Getting Started After logging in, you'll find AI tools in the Applications menu. For more information, see the documentation in /usr/share/doc/nanite/ EOF -
Calculate checksums:
sha256sum Nanite-VirtualBox.ova > Nanite-VirtualBox.sha256 sha256sum Nanite-VMware.ova > Nanite-VMware.sha256 -
Package everything together:
mkdir Nanite-VM-Images cp Nanite-VirtualBox.ova Nanite-VirtualBox.sha256 Nanite-VM-Images/ cp Nanite-VMware.ova Nanite-VMware.sha256 Nanite-VM-Images/ cp Nanite-VM-README.md Nanite-VM-Images/README.md zip -r Nanite-VM-Images.zip Nanite-VM-Images/
Conclusion
Creating VM images for Nanite provides an easy way for users to try the distribution without performing a full installation. By following this guide, you can create optimized, user-friendly VM images for both VirtualBox and VMware platforms.
The resulting VM images offer several advantages:
- Immediate usability: Users can run Nanite immediately without installation
- Consistent environment: All users get the same pre-configured environment
- Easy testing: Developers and testers can quickly deploy and test Nanite
- Portability: VM images can be moved between different host systems
Remember to thoroughly test the VM images before distribution to ensure they provide a positive first experience for users exploring Nanite’s AI capabilities.