Virtual Machine

From Maemo Leste Wiki
Revision as of 12:45, 27 May 2020 by Brabo (talk | contribs)
Jump to navigationJump to search

This page or section is a stub. Ask how you can help improve leste.maemo.org by visiting #maemo-leste, look at the bugtracker (https://github.com/maemo-leste/bugtracker) or if you are able to contribute to the current page, then you are welcome to do so.

Virtual Machine
Manufacturer Generic
Specifications
Hardware Features
Software Features

Generic virtual machine target. This is particularly useful when doing development and testing.

Installation

https://maedevu.maemo.org/images/virtual-machines/

There are three different types of images: VirtualBox (.box), QEMU (.qcow2, .vdi) and Vagrant. The VirtualBox image may be converted to a VMware VMDK image which has been reported to perform better and have good hardware acceleration. Converting the qcow2 image to raw allows it to be used on real hardware.

VirtualBox

Download latest .vdi.xz image, unpack it with "xz -d" command. Create new Virtual Machine, select "Debian (64-bit)" and 1024MB RAM. Use the downloaded file as virtual hard disk. You are done!

QEMU

In general something like

 qemu-system-x86_64 -hda maemo-leste-1.0-amd64.qcow2 -enable-kvm -cpu host -smp cores=2 -m 1024

should work. But there seem to be issues with some QEMU versions, for more details see issue#198.

To set up a port forward for SSH, add:

 -nic user,hostfwd=tcp:127.0.0.1:7722-:22

And then log in like this (password: toor):

 ssh root@localhost -p 7722

If the mouse pointer is grabbed and no cursor shows, you can add

 -usb -device usb-tablet

to the command line

If you have a USB modem you can also use that in QEMU. You can either use sudo to elevate your privileges to be able to use it:

 sudo qemu-system-x86_64 -hda maemo-leste-1.0-amd64-virtual-20200324.qcow2 -enable-kvm -cpu host -smp cores=2 -m 1024 \
 -nic user,hostfwd=tcp:127.0.0.1:7722-:22 \
 -usb -device usb-ehci,id=ehci \
 -device usb-host,bus=ehci.0,vendorid=0x0bdb,productid=0x193e

Or you can make a udev rule for your device. For example, with a Lenovo Ericsson N5321 gw you can create "/etc/udev/rules.d/45-n5321.rules" with this in it:

 # Lenovo Ericsson N5321 gw simple udev rule
 SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bdb", ATTRS{idProduct}=="193e", \
   MODE:="0666"

And then activate it by running these two commands as root:

 # udevadm control --reload-rules
 # udevadm trigger

Now you can run QEMU without the need for sudo!

Initial configuration

On the first run you may want to generate ssh host keys and set the timezone. To do so open the "X Terminal" application and run:

sudo su -
dpkg-reconfigure openssh-server
dpkg-reconfigure tzdata

Make the system up-to-date:

apt update
apt upgrade
apt install linux-image-amd64
reboot

To get networking to work (at least in virtualbox), launch a shell and do

sudo ifconfig eth0 up
sudo dhclient eth0