The officially official Devuan Forum!

You are not logged in.

#26 2019-02-08 16:37:38

Geoff 42
Member
Registered: 2016-12-15
Posts: 336  

Re: Xen and the art of VM

Other USB devices

Having got a memory stick working I tried a portable DVD drive

usbip port
Imported USB devices
====================
Port 00: <Port in Use> at High Speed(480Mbps)
       LaCie, Ltd : unknown product (059f:0643)
       1-1 -> usbip://192.168.42.9:3240/1-2
           -> remote bus/dev 001/005

This worked and I was able to play an audio CD through VLC, once I had added myself to the group "cdrom". "eject" also worked.

Later I tried to put a video DVD in... Unfortunately this hung Dom0!

The DVD was mounted in Dom0 and then an info request came from DomU and then an attach request. This attachment seemed to complete and then there was a "general protection fault: 0000 [#1] SMP NOPTI" followed by a traceback from usbip-host on Dom0 and then the kernel went into a loop of tracebacks. Time to hit the power switch...

I spotted a USB bluetooth dongle for £1 in a charity shop, so I bought it. My Dom0 machine hasn't got bluetooth installed, but I attached it through to the Beowulf DomU and bluetoothctl show returns some plauseable looking data. I have yet to work out how to get it to actually do anything useful, despite having read man bluetoothctl!

bluetoothctl
Agent registered
[bluetooth]# help

is more informative, but bluetoothctl seems to have to be run as root to actually report anything.

[bluetooth]# discoverable on
Failed to set discoverable on: org.bluez.Error.Failed

The Bluetooth dongle could be seen, but I was not sure what to do with it. Connman was also able to see the dongle.

The next thing I tried was an external USB disk drive, a Samsung M3 Portable, which is USB 3 and, I recall 2TB. Unfortunately this did not work. I seemed that it was possible to connect it through to DomU but then it disconnects with the error :-

[ 5286.237272] usb usb2-port1: Cannot enable. Maybe the USB cable is bad?

USBIP seems to work in the general case, but some more extreme uses cause it problems. I think that it was problems with USBIP rather than Xen.

Geoff

Offline

#27 2020-06-01 14:37:08

Geoff 42
Member
Registered: 2016-12-15
Posts: 336  

Re: Xen and the art of VM

netinstall of Beowulf

I have managed to install Beowulf under Xen using the netinstall iso,
devuan_beowulf_3.0.0_netinstall-amd64.iso

After some intial difficulty with partitioning the disk used by Xen
I now have it running.

I had already allocated two chunks of file space using lvm. On
my machine these were :-

/dev/HDD0/net-disk (20GB)
/dev/HDD0/net-swap (4GB)

As root check the config is set up :-

cd /etc/xen
cat net.cfg

#
# Configuration file for the Xen instance "net" for a Devuan iso
#

# Boot info for the iso. Don't forget to mount it at /mnt/inst_iso with something like :-
# mount -t iso9660 /archive/isos/devuan_beowulf_3.0.0_netinstall-amd64.iso /mnt/inst_iso/

# You can choose whether to get a larger VNC window with the
# xen-fbfront.video option but you do get two cursors!

kernel = '/mnt/inst_iso/boot/isolinux/linux'
ramdisk = '/mnt/inst_iso/boot/isolinux/initrd.gz'
extra  = 'boot=boot/isolinux username=devuan console=hvc0 xen-fbfront.video=32,1600,1000'

# Boot info for the installed OS. We need kernel and ramdisk if grub failed to install :-
# We can use pygrub if grub was installed.

# kernel      = '/vmlinuz'
# ramdisk     = '/initrd.img'
# # bootloader  = '/usr/bin/pygrub'
# extra       = 'console=hvc0 xen-fbfront.video=32,1600,1000'
# root        = '/dev/xvda2 ro'

#
#  Disk device(s).
#

disk        = [
                  'format=raw, vdev=xvdc,  access=r, devtype=cdrom, target=/archive/isos/devuan_beowulf_3.0.0_netinstall-amd64.iso',
                  'format=raw, vdev=xvda2, access=w, target=/dev/HDD0/net-disk',
                  'format=raw, vdev=xvda1, access=w, target=/dev/HDD0/net-swap',
              ]

#
#  Local set-up
#
#   Limits

vcpus       = '2'
memory      = '2048'

#
#  Hostname
#
name        = 'net'

#
#  Networking
#

vif         = [ 'mac=00:16:3E:00:00:06, bridge=xenbr0' ]

# Graphic display

vfb         = [ 'vnc = 1,  keymap = "en-gb"' ]

#
#  Behaviour
#
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'

With this file set up and the iso mounted we can boot the netinstaller, as root :-

xl create net.cfg -c

select languages etc.
set up host name etc.
For the disk set up I selected "manual"
The disk had been used and I set up partition 1 on xvda2
as ext4 for /
This worked.

If it doesn't work try this ...
disk set-up choose <Go Back>
we get the main menu, choose "Execute a shell"

fdisk -l
mkfs.ext4 -n -L root /dev/xvda2
mkfs.ext4 -L root /dev/xvda2
mkswap -L swap /dev/xvda1

exit back to the menu.
select partition the disk and select manual.

Continue here ...
select the partition under /dev/xvda2
set up the one partition on /dev/xvda2 as ext4 to use as /
Finish partitioning and write changes to disk
continues to install base system
it couldn't read the CD, tell it to continue
it then goes on to select a repository
and continues
Software selection, I chose
LXQt, SSH and Console productivity
check it has got going
go and make a cup of tea
I then selected openrc as the init system, because I have been playing with it.

Install grub fails
continue with no grub
finishes up and shutsdown

Back on Dom0

xl list
xl destroy net
xl list

Comment out the boot info for the iso and
set up the kernel and ramdisk info in the config file

kernel      = '/vmlinuz'
ramdisk     = '/initrd.img'
# bootloader  = '/usr/bin/pygrub'
extra       = 'console=hvc0 xen-fbfront.video=32,1600,1000'
root        = '/dev/xvda2 ro'

and comment out the CD/iso.

disk        = [
#                  'format=raw, vdev=xvdc,  access=r, devtype=cdrom, target=/archive/isos/devuan_beowulf_3.0.0_netinstall-amd64.iso',
                  'format=raw, vdev=xvda2, access=w, target=/dev/HDD0/net-disk',
                  'format=raw, vdev=xvda1, access=w, target=/dev/HDD0/net-swap',
              ]

Now we can boot the installed OS

xl create net.cfg
xl console net

and it boots. So, it doesn't need grub to boot, as you have
pointed Xen at the kernel and initrd.

As yourself run :-

vncviewer :0 &

You should have the Lightdm login screen.
There is a problem with the vnc cursor getting its units
wrong and moving faster than the real cursor, depending
on how large you have made your VNC screen!

Could try :-

grub-install /dev/xvda2

except that grub-install isn't there!

Running Synaptic :-
Only grub-common has been installed.
install grub-pc

E:grub-pc: installed grub-pc package post-installation script
subprocess returned exit status 255

but the three packages are installed.

grub-install /dev/xvda2

this fails

grub-mkconfig -o /boot/grub/grub.cfg

This works.

Shutdown and edit the Xen config file to enable PyGrub.

# Boot info for the installed OS. We need kernel and ramdisk if grub failed to install :-
# Use pygrub if grub was installed.

# kernel      = '/vmlinuz'
# ramdisk     = '/initrd.img'
bootloader  = '/usr/bin/pygrub'
extra       = 'console=hvc0 xen-fbfront.video=32,1600,1000'
root        = '/dev/xvda2 ro'

then :-

xl create net.cfg -c

pyGRUB  version 0.6
┌────────────────────────────────────────────────────────────────────────┐
│ Debian GNU/Linux                                                                                                                     │
│ Debian GNU/Linux, with Linux 4.19.0-9-amd64                                                                             │
│ Debian GNU/Linux, with Linux 4.19.0-9-amd64 (recovery mode)                                                    │
│                                                                                                                                                │
│                                                                                                                                                │
│                                                                                                                                                │
│                                                                                                                                                │
│                                                                                                                                                │
└────────────────────────────────────────────────────────────────────────┘
     Use the ^ and v keys to select which entry is highlighted.           
     Press enter to boot the selected OS, 'e' to edit the     
     commands before booting, 'a' to modify the kernel arguments
     before booting, or 'c' for a command line.

This then boots as expected. It does set the screen to 24x80 but you
can choose your kernel etc. If all is well and you just want to
boot the standard kernel use this and avoid the 24x80 screen :-

xl create net.cfg
xl console net

To get VNC working properly (i.e. with the cursor behaving) :-

On the new VM (net)

apt install vnc4server

Then from Dom0 as yourself :-

ssh -L 5901:localhost:5901 net

and on "net" (DomU)

vncserver -geometry 1600x1000

leave this window running to keep the ssh tunnel open.

and back on the host OS (Dom0)

vncviewer :1

You should have a nice big screen where the cursor works
properly and where you can copy and paste with Dom0 windows.
It does not test the lightdm login screen, as you are already
logged in when you run vncserver.

Offline

Board footer