linux · tech · tips

Create a Windows 7 installation USB stick from Linux

I’ll save you the tutorial, just download winusb and run it using the commands detailed at the official website. It’s the fastest way to get your bootable usb stick.

If you – like me – find yourself stuck at a grub prompt after booting the USB stick, run:

grub> ntldr /bootmgr

The installation will start then.

linux · tech

Creating a new libvirt Virtual Machine from the command line with virt-install

Scenario: a remote Linux server with many CPUs and lots of RAM is your virtual host. You want to create a new guest virtual machine and you want access via VNC to the installation process. In my case, I was using KVM as the hypervisor, but libvirt should work seamlessly with Xen and LXC too.

First thing, I created the disk image for my VM, then I started the installation with virt-install:

# qemu-img create -f qcow2 /var/lib/libvirt/images/my-virt-machine.img 100G
# virt-install --name "MyVirtMachine" --vcpus 1 --ram 512 \
--disk /var/lib/libvirt/images/my-virt-image.img \
--cdrom /var/lib/libvirt/images/ubuntu-12.04.1-server-amd64.iso 
--os-type linux --network network=default \

Let’s see what’s happening:

  • –name “MyVirtMachine”: your virtual machine’s name
  • –vcpus 1: number of CPUs available to the VM
  • –ram 512: megabytes of memory available to the VM
  • –disk /var/[…].img: the path to the disk image
  • –cdrom /var/[…].iso: the path to the ISO image of the installation disk
  • –os-type linux: the OS we will install on the VM
  • –network network=default: configure the VM to use the default network provided by libvirt
  • –graphics=vnc,password=trustworthypass,listen=,port=5903: connect the VM to a VNC server listening on every interface ( on port 5903 with password trustworthypass

Now you can connect to the IP address of your hypervisor on port 5903 with a VNC client to complete the installation.