Posts Tagged ‘virtualbox’
Mount a shared drive with VirtualBox
Case
You have to share some content between the host (eg: Linux Mint) and the resident (eg: Windows 7) systems, with Virtual Box.
Solution
- In the resident system, go to Virtual Box, then:
Machine>Settings> SharedFolders> on the right:Add> checkautomountandpermanent, browse to the folder, let’s sayD:\sharedFolder - Launch the VM.
- Execute a terminal in host system:
- Grant rights of group
vboxsfto usermint:
sudo gpasswd -a mint vboxsf
- Create a “local” folder:
mkdir ~/sharedFolder
- Mount the folder
sharedFolderon/home/:
sudo mount -t vboxsf -o uid=1000,gid=1000 sharedFolder ~/sharedFolder
(long tweet) How to make ChromeOS work in VirtualBox without Wifi?
Case
How to make ChromeOS work in VirtualBox without Wifi, ie on an ethernet/wired local network, or even offline?
Quick Fix
Shutdown the VM > Select it > Settings > Network > Advanced > Adapter Type > select “Paravirtualized Network (virtio-net)”
(long tweet) Virtual Box / PAE processor
Case
On booting ChromeOS Vanilla within Virtual Box, I got the following error:
[java]This kernel requires the following features not present on the CPU: pae
Unable to boot – please use a kernel appropriate for your CPU.[/java]
(Actually, the problem occured with ChromeOS but may have appened with another system)
Quick Fix
In Virtual Box, select the VM > Settings > Processor > check “Enable PAE/NX”.
Tutorial: a Windows XP as guest VM in Virtual Box
Target and Constraints
I need a Windows XP running as a virtual machine (VM). Don’t think of using your former OEM licence, it won’t work: Windows checks and makes a difference between OEM and other licences.
Microsoft provides VHD files: you can consider them as “virtual” HDD. Officially, these VHD files are intented at developpers to test their websites on various Windows (XP to Seven) and Internet versions (6 to 9).
The VHD files provided for Windows XP need a licence key to be activated, and therefore have two main drawbacks:
- after three days and/or three reboots, the system will allow you to log in anymore. That’s quiet a limitation :-(.
- But wait, there’s even worse: the VHD file provided by Microsoft will be completely disabled on February 14th, 2013!
At last, I stress on having an absolutely legal solution, since it will be deployed both on personnal (Ubuntu) and professional (Windows 8 ) desktop computers. I do not want to waste my time playing hide and seek with authorities.
Prerequisites
In this post I will assume you are a bit familiar with working on VirtualBox. If you are not, then browse the web, ask Google, RTFM, or, at last, leave a message in the comments, I’ll try to figure out a moment to write a short tutorial.
- Download Windows XP VHD file from this page: Internet Explorer Application Compatibility VPC Image. Even though you get a
.exefile, you can uncompress it with a regular 7-zip. - Download Windows XP SP3 iso file from that page: Windows XP Service Pack 3 – ISO-9660 CD Image File. Keep the
xpsp3_5512.080413-2113_usa_x86fre_spcd.isoas is. - Download PCINTPC5 ethernet drivers from this page: NDIS5 Driver for Microsoft Windows Server 2003, Windows XP, Windows 2000, Windows ME and Windows 98.
- Unzip and convert this V4.51.zip as an ISO file: as a reminder, the Linux command is:[java]mkisofs -o target.iso -J –rock sourceFolder[/java]
- Alternatively, you can download that ISO that I prepared: ethernet_drivers_for_WinXP_VirtualBox.iso (don’t forget to thank me for the precomputed work)
Operations
Classic
- Create a VM within VirtualBox
- Name it “Windows XP” for instance
- Set the VHD file as the one downloaded and unzipped above.
Specific
- Run the VM. You must log in as IEUser. The default password is
Password1(on French keyboards:Pqsszord&) - Do not validate the licence.
- The VM will require
CmBatt.sys(and possibly another one):- On host system: mount SP3 iso
device > CD/DVD Devices> Choose a virtual CD/DVD virtual file >select WinXP SP3 ISO (xpsp3_5512.080413-2113_usa_x86fre_spcd.iso) - On guest system: run the CD, eg:
Windows+E > D:\ > Autoplay > Install. All the files will be unzipped in a folder such asC:\1a2b3c4d5e...(with hexadecimal value). - In the frame asking for
CmBatt.sys, select it inC:\1a2b3c4d5e...\i386
- On host system: mount SP3 iso
- Windows XP will ask for drivers and try to download them. But the ethernet card has not yet been installed!
- On host system:
-
- Mount the ethernet_drivers_for_WinXP_VirtualBox.iso (cf. above for details)
- Devices > Install Guest Additions > accept all
- On guest system: manually install drivers for ethernet card.
- In order to bypass the limitation of February 14th,
- if you read this post after February 14th, 2013: set the system time to January 1st 2013 for instance (I didn’t test ; it should work)
- disable time synchronization between host and guest systems, eg:[java]$VIRTUALBOX_HOME/app32/VBoxManage setextradata "Windows XP" "VBoxInternal/Devices/VMMDev/0/Config/GetHostTimeDisabled" 1[/java]
Now everything should work. I suggest to take a snapshot ;-), and then to revert to it as often as needed.
Conclusions
Officialy, the VHD files provided by Microsoft are intented at developpers who need test their websites on obsolete and out-of-date browsers like Internet Explorer. But you can imagine many other usages. On my side, the interest is to have VM as a module in a complete integrated testing environment and in the frame of a software forge.
My opinion? The solution provided by Microsoft does exist, it’s better than nothing ; anyway, implementing it is a far hard matter. Limitations and complexity of install spoil the user experience. It’s a pity, because the idea of VHD is great, but does not match that of precompiled open source Virtual Boxes: http://www.virtualboxes.org
[DevoxxFR2012] DevOps: Extending Beyond Server Management to Everyday Workflows
Lecturer
Jérôme Bernard is Directeur Technique at StepInfo, with over a decade in Java development for banking, insurance, and open-source projects like Rio, Elastic Grid, Tapestry, MX4J, and XDoclet. Since 2008, he has focused on technological foresight and training organization, innovating DevOps applications in non-production contexts.
Abstract
This article scrutinizes Jérôme Bernard’s unconventional application of DevOps tools—Chef, VirtualBox, and Vagrant—for workstation automation and virtual environment provisioning, diverging from traditional server ops. It dissects strategies for Linux installations, disposable VMs for training, and rapid setup for development. Framed against DevOps’ cultural shift toward automation and collaboration, the analysis reviews configuration recipes, box definitions, and integration pipelines. Through demos and case studies, it evaluates efficiencies in resource allocation, reproducibility, and skill-building. Implications highlight DevOps’ versatility for desktop ecosystems, reducing setup friction and enabling scalable learning infrastructures, with updates reflecting 2025 advancements like enhanced Windows support.
Rethinking DevOps: From Servers to Workstations
DevOps transcends infrastructure; Jérôme posits it as a philosophy automating any repeatable task, here targeting workstation prep for training and dev. Traditional views confine it to CI/CD for servers, but he advocates repurposing for desktops—installing OSes, tools, and configs in minutes versus hours.
Context: StepInfo’s training demands identical environments across sites, combating “it works on my machine” woes. Tools like Chef (configuration management), VirtualBox (virtualization), and Vagrant (VM orchestration) converge: Chef recipes define states idempotently, VirtualBox hosts hypervisors, Vagrant scripts provisioning.
Benefits: Reproducibility ensures consistency; disposability mitigates drift. In 2025, Vagrant’s 2.4 release bolsters multi-provider support (e.g., Hyper-V), while Chef’s 19.x enhances policyfiles for secure, auditable configs—vital for compliance-heavy sectors.
Automating Linux Installations: Recipes for Consistency
Core: Chef Solo for standalone configs. Jérôme demos a base recipe installing JDK, Maven, Git:
package 'openjdk-11-jdk' do
action :install
end
package 'maven' do
action :install
end
directory '/opt/tools' do
owner 'vagrant'
group 'vagrant'
mode '0755'
end
Run via chef-solo -r cookbook_url -o recipe[base]. Idempotency retries only changes, preventing over-provisioning.
Extensions: Roles aggregate recipes (e.g., “java-dev” includes JDK, IDE). Attributes customize (e.g., JAVA_HOME). For training, add user accounts, desktops.
2025 update: Chef’s InSpec integration verifies compliance—e.g., audit JDK version—aligning with zero-trust models. Jérôme’s approach scales to fleets, prepping 50 machines identically.
Harnessing Virtual Machines: Disposable and Pre-Configured Environments
VirtualBox provides isolation; Vagrant abstracts it. A Vagrantfile defines boxes:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/jammy64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
config.vm.provision "chef_solo" do |chef|
chef.cookbooks_path = "cookbooks"
chef.add_recipe "base"
end
end
vagrant up spins VMs; vagrant destroy discards. For training: Share Vagrantfiles via Git, students vagrant up for instant labs.
Pre-config: Bake golden images with Packer, integrating Chef for baked-in states. Jérôme’s workflow: Nightly builds validate boxes, ensuring JDK 21 compatibility.
In 2025, Vagrant’s cloud integration (e.g., AWS Lightsail) extends to hybrid setups, while VirtualBox 7.1’s Wayland support aids Linux GUIs—crucial for dev tools like IntelliJ.
Integrating Chef, VirtualBox, and Vagrant: A Synergistic Pipeline
Synergy: Vagrant invokes Chef for provisioning, VirtualBox as backend. Jérôme’s pipeline: Git repo holds Vagrantfiles/recipes; Jenkins triggers vagrant up on commits, testing via Vagrant plugins.
Advanced: Multi-VM setups simulate clusters—e.g., one for app server, one for DB. Plugins like vagrant-vbguest auto-install guest additions.
Case: Training VM with Eclipse, Tomcat, sample apps—vagrant ssh accesses, vagrant halt pauses. For dev: Branch-specific boxes via VAGRANT_VAGRANTFILE=dev/Vagrantfile vagrant up.
2025 enhancements: Chef’s push jobs enable real-time orchestration; Vagrant’s 2.5 beta supports WSL2 for Windows devs, blurring host/guest lines.
Case Studies: Training and Development Transformations
StepInfo’s rollout: 100+ VMs for Java courses, cutting prep from days to minutes. Feedback: Trainees focus on coding, not setup; instructors iterate recipes post-session.
Dev extension: Per-branch environments—git checkout feature; vagrant up yields isolated sandboxes. Metrics: 80% setup time reduction, 50% fewer support tickets.
Broader: QA teams provision test beds; sales demos standardized stacks. Challenges: Network bridging for multi-VM comms, resolved via private networks.
Future Directions: Evolving DevOps Horizons
Jérôme envisions “Continuous VM Integration”—Jenkins-orchestrated nightly validations, preempting drifts like JDK incompatibilities. Windows progress: Vagrant 2.4’s WinRM, Chef’s Windows cookbooks for .NET/Java hybrids.
Emerging: Kubernetes minikube for containerized VMs, integrating with GitOps. At StepInfo, pilots blend Vagrant with Terraform for infra-as-code in training clouds.
Implications: DevOps ubiquity fosters agility beyond ops—empowering educators, devs alike. In 2025’s hybrid work, disposable VMs combat device heterogeneity, ensuring equitable access.
Jérôme’s paradigm shift reveals DevOps as universal automation, transforming mundane tasks into streamlined symphonies.