Skip to content

Instantly share code, notes, and snippets.

@svofski
Last active May 13, 2018 22:37
Show Gist options
  • Save svofski/5f31af0a86884e816eb9 to your computer and use it in GitHub Desktop.
Save svofski/5f31af0a86884e816eb9 to your computer and use it in GitHub Desktop.
HOWTO

HOWTO

Various config and setup notes

libvirt/kvm

Connecting to remote from OSX

virsh -c qemu+ssh://usrname@host/system?socket=/var/run/libvirt/libvirt-sock

Connecting to the server will result in an error : "hangup / error event on socket". It turns out that the macosx client assumes the socket resides in /usr/local/lib whereas the ubuntu server has the socket in /var/run/libvirt/libvirt-sockhttp://www.planetdevops.net/index.php/category/libvirt/

Half-functional raspbian setup

http://markus.heberling.net/tag/libvirt/

Creating a new Debian Wheezy with net install

http://www.server-world.info/en/note?os=Debian_7.0&p=kvm&f=2

virt-install
-n www
-r 2048
-f /var/kvm/images/www.img
-s 20
--vcpus=2
--os-type linux
--os-variant=debianwheezy
--network bridge=br0
--nographics
--location='http://ftp.riken.jp/Linux/debian/debian/dists/wheezy/main/installer-amd64/'
--extra-args='console=tty0 console=ttyS0,115200n8 serial'

Newer version, with spice:

virt-install
--name popov
--ram 1024
-f /home/libvirt/images/popov/popov.img -s 5
--vcpus=2
--os-type linux
--os-variant=debianwheezy
--network bridge=br0
--location='http://ftp.riken.jp/Linux/debian/debian/dists/jessie/main/installer-amd64/'
--extra-args='console=tty0 console=ttyS0,115200n8 serial' --graphics spice,listen=0.0.0.0

Creating and marking default network for autostart

This is needed for autostart VMs to actually autostart

# virsh net-start default
# virsh net-autostart default

Marking a domain for autostart

# virsh autostart domainname

Start a domain without defining

# virsh create domaindef.xml

Defining a domain from xml without virt-install

# virsh define domaindef.xml

Mount a qcow2 image

modprobe nbd max_part=63 qemu-nbd -c /dev/nbd0 image.qcow2 mount /dev/nbd0p1 /mnt/p1

Linux in general

No bullshit wlan setup:

Add to /etc/network/interfaces:

auto wlan0
iface wlan0 inet dhcp
  wpa-ssid <ssid>
  wpa-psk  <password>

Monitor filesystem events

apt-get install incron

incrontab -l prints user incrontab

Windows XP Activation Loop

See: http://troubleshooting-101.blogspot.ru/2012/02/windows-xp-activation-loop-cant-log-on.html

In full Safe Mode:

regsvr32 regwizc.dll
regsvr32 licdll.dll
rundll32.exe syssetup,SetupOobeBnk

It is important to wait a few minutes until the last command stops background processing before rebooting into normal mode.

Debian Linux on Mac Mini

Sensor definitions

See:

/etc/sensors.d/applesmc-isa-0300.conf:

chip "applesmc-isa-0300"
        label "temp1" "Ambient"
        label "temp2" "CPU Die"
        label "temp3" "Unknown TC0G"
        label "temp4" "CPU Heatsink"
        label "temp5" "CPU Proximity"
        label "temp6" "Unknown TC0p"
        label "temp7" "Unknown TCPG"
        label "temp8" "Unknown TH0G"
        label "temp9" "Hard Disk Proximity"
        label "temp10" "Unknown TH0p"
        label "temp11" "Unknown TM0G"
        label "temp12" "Misc Motherboard Proximity TM0P"
        label "temp13" "Misc Motherboard Proximity TM0p"
        label "temp14" "Unknown TN0D"
        label "temp15" "Unknown TN0G"
        label "temp16" "Unknown TN0P"
        label "temp17" "Unknown TN0p"
        label "temp18" "Unknown TN1D"
        label "temp19" "Unknown TN1E"
        label "temp20" "Unknown TN1F"
        label "temp21" "Unknown TN1G"
        label "temp22" "Unknown TN1S"
        label "temp23" "Unknown TNPG"
        label "temp24" "Optical Disk Drive Proximity"
        label "temp25" "Optical Disk Drive Proximity TO0p"
        label "temp26" "Wireless Proximity"
        label "temp27" "Misc Local Temp"
        label "temp28" "Unknown Tp0C"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment