CHR: Installing on VirtualBox
CHR: Installing on VirtualBox
Section titled “CHR: Installing on VirtualBox”This guide provides detailed instructions for installing Cloud Hosted Router (CHR) on VirtualBox. VirtualBox is a free, open-source hypervisor that runs on Windows, macOS, and Linux hosts.
Prerequisites
Section titled “Prerequisites”Before beginning the installation, ensure you have:
- A host system with 64-bit processor and virtualization support (Intel VT-x or AMD-V)
- Sufficient system resources (minimum 256MB RAM for CHR, 1024MB recommended)
- Latest version of VirtualBox installed
- CHR virtual disk image in VDI format
Download Required Software
Section titled “Download Required Software”VirtualBox
Section titled “VirtualBox”Download and install the latest version of VirtualBox from the official VirtualBox website. VirtualBox is available for Windows, macOS, and Linux hosts.
CHR Image
Section titled “CHR Image”Download the Cloud Hosted Router VDI image from the MikroTik download page in the Cloud Hosted Router section. Choose between:
- Stable: Recommended for production deployments with proven stability
- Testing: Latest features with potential for bugs
- Development: Early access to new features under development
Extract the downloaded archive to access the .vdi disk image file.
Create Virtual Machine
Section titled “Create Virtual Machine”Step 1: Launch Virtual Machine Creation
Section titled “Step 1: Launch Virtual Machine Creation”- Open VirtualBox application
- Click New to create a new virtual machine
- Configure the basic settings:
| Setting | Value |
|---|---|
| Name | MikroTik_CHR (or your preferred name) |
| Type | Linux |
| Version | Other Linux (64-bit) |
Always select the 64-bit version to ensure CHR can utilize available RAM and CPU resources efficiently.
Step 2: Configure Memory
Section titled “Step 2: Configure Memory”Allocate memory for the virtual machine:
| RouterOS Version | Minimum RAM | Recommended RAM |
|---|---|---|
| RouterOS v6 | 256 MB | 512 MB |
| RouterOS v7 | 256 MB | 1024 MB |
The formula for calculating minimum RAM is:
# RouterOS v6RAM = 128 + [ 8 × (CPU_COUNT) × (INTERFACE_COUNT - 1) ]
# RouterOS v7RAM = 256 + [ 8 × (CPU_COUNT) × (INTERFACE_COUNT - 1) ]For most deployments, allocate at least 1024MB of RAM for stable operation.
Step 3: Configure Processors
Section titled “Step 3: Configure Processors”Select the number of virtual CPUs based on your throughput requirements:
- Single CPU: Sufficient for basic routing and small networks
- Multiple CPUs: Required for multi-core routing, fast path processing, and higher throughput
Step 4: Create Virtual Hard Disk
Section titled “Step 4: Create Virtual Hard Disk”- Select Use an existing hard disk file
- Click the folder icon to browse
- Navigate to and select the downloaded CHR
.vdifile - Click Choose to attach the disk
Step 5: Review Settings
Section titled “Step 5: Review Settings”Verify all configuration settings before creating the virtual machine:
| Component | Recommended Setting |
|---|---|
| Memory | 1024 MB or more |
| CPUs | 1-4 depending on workload |
| Disk | CHR VDI image |
| Boot Order | Hard Disk first |
Click Finish to create the virtual machine.
Configure Virtual Machine Settings
Section titled “Configure Virtual Machine Settings”System Settings
Section titled “System Settings”- Select your newly created VM
- Click Settings
- Navigate to System tab
- Adjust boot order:
- Move Hard Disk to top position
- Remove Floppy from boot order
- Keep Optical if you need to attach ISO images later
Processor Settings
Section titled “Processor Settings”- Navigate to Processor tab
- Select desired number of virtual CPUs
- Enable PAE/NX if available (provides access to additional CPU features)
Network Configuration
Section titled “Network Configuration”Network adapters are critical for CHR functionality:
| Adapter Mode | Use Case |
|---|---|
| NAT | Simple internet access, default gateway for VM |
| Bridged Adapter | Direct network access, VM appears as separate device |
| Internal Network | Isolated network between VMs |
| Host-Only | Management access from host system only |
Configure adapter settings:
- Navigate to Network tab
- Enable Adapter 1
- Select appropriate attachment type
- Configure advanced options as needed
Bridged Adapter Configuration
Section titled “Bridged Adapter Configuration”For production deployments where CHR needs direct network access:
- Select Bridged Adapter from the dropdown
- Choose the host’s physical network adapter
- Verify MAC address if needed
NAT Configuration
Section titled “NAT Configuration”For testing or simple routing scenarios:
- Select NAT from the dropdown
- CHR will use VirtualBox’s NAT gateway
- Configure port forwarding if inbound connections are needed
Storage and Other Settings
Section titled “Storage and Other Settings”Review additional settings:
- Audio: Disable if not needed (CHR does not use audio)
- USB: Disable if not required
- Shared Folders: Configure if you need file transfer between host and CHR
Start Virtual Machine
Section titled “Start Virtual Machine”Boot Process
Section titled “Boot Process”- Select the CHR virtual machine
- Click Start to power on
- Observe the boot sequence
The CHR will boot from the VDI image and display the RouterOS login prompt.
Login Credentials
Section titled “Login Credentials”Default login credentials:
| Field | Value |
|---|---|
| Username | admin |
| Password | (none - leave blank) |
RouterOS 7.xMikroTik login: adminPassword:Change the default admin password immediately after first login for security.
Initial Configuration
Section titled “Initial Configuration”Basic Setup Commands
Section titled “Basic Setup Commands”After logging in, perform basic configuration:
# Set admin password/user set admin password="your-secure-password"
# View current interfaces/interface print
# Configure IP address on ether1/ip address add address=192.168.1.1/24 interface=ether1
# Configure default gateway/ip route add gateway=192.168.1.254
# Set hostname/system identity set name="CHR-VirtualBox"Network Verification
Section titled “Network Verification”Verify network connectivity:
# Test gateway connectivityping 192.168.1.254
# Test internet connectivityping 8.8.8.8
# Check resource usage/system resource printEnable Remote Access
Section titled “Enable Remote Access”WinBox connects to routers using TCP port 8291 (the default port). Configure remote management access:
# Enable WinBox on port 8291 (default)/ip service enable winbox
# Enable API on port 8728/ip service enable api
# Enable webfig on port 80/ip service enable www
# Restrict access to management services/ip service set winbox address=192.168.1.0/24First Boot Recommendations
Section titled “First Boot Recommendations”After initial setup:
- Update RouterOS: Check for and install latest updates
- Configure NTP: Set time synchronization for license management
- Setup DNS: Configure DNS servers for name resolution
- Create Backups: Export configuration after testing
- Configure Firewall: Secure management access
VirtualBox-Specific Considerations
Section titled “VirtualBox-Specific Considerations”Performance Optimization
Section titled “Performance Optimization”For optimal CHR performance on VirtualBox:
| Setting | Recommendation |
|---|---|
| Memory | Allocate minimum 1024MB |
| CPUs | 2+ vCPUs for production |
| Network Adapter | Virtio if available, otherwise Intel PRO/1000 |
| Disk Controller | SATA or IDE (not SCSI for system disk) |
| VT-x/AMD-V | Enable for hardware acceleration |
Guest Additions
Section titled “Guest Additions”VirtualBox Guest Additions are not required for CHR but can provide:
- Better mouse integration
- Shared folders for file transfer
- Improved video resolution
Resource Monitoring
Section titled “Resource Monitoring”Monitor CHR resources within VirtualBox:
# View resource usage/system resource print
# View interface statistics/interface print detail
# Monitor CPU usage by process (RouterOS v7 syntax; duration in seconds)/tool/profile duration=3Troubleshooting
Section titled “Troubleshooting”VM Will Not Start
Section titled “VM Will Not Start”Issue: Virtual machine fails to start with error about VT-x/AMD-V
Solution:
- Enable virtualization in host BIOS/UEFI settings
- Disable hyper-threading if causing conflicts
- Ensure 64-bit version of CHR is being used
No Network Connectivity
Section titled “No Network Connectivity”Issue: CHR cannot reach external networks
Solutions:
- Verify VirtualBox network adapter is attached
- Check bridged adapter is connected to correct host interface
- Verify CHR IP configuration and gateway settings
- Test with NAT adapter mode first
Slow Performance
Section titled “Slow Performance”Issue: CHR experiences poor throughput
Solutions:
- Allocate more RAM to the VM
- Add additional vCPUs
- Use Intel PRO/1000 network adapter
- Ensure hardware virtualization is enabled
- Reduce VM memory overhead from host applications
Cannot Access Management Interface
Section titled “Cannot Access Management Interface”Issue: Cannot connect via WinBox, WebFig, or API
Solutions:
- Verify IP address is configured correctly
- Check firewall rules on CHR
- Ensure VirtualBox is not blocking connections
- Test with ping first to verify IP connectivity
- Verify services are enabled:
/ip service print
Disk Space Issues
Section titled “Disk Space Issues”Issue: CHR reports low disk space
Solutions:
- Expand virtual disk size in VirtualBox settings
- Clean up log files:
/log printand clear old entries - Remove unused packages:
/system package print - Consider using RAW disk image for larger allocations