Installing a vmdk under QEMU/KVM

OpenVMS virtualization: OpenVMS on VirtualBox, VMWare, Hyper-V, KVM, and more.
Post Reply
User avatar

Topic author
martin
Valued Contributor
Posts: 73
Joined: Tue Mar 22, 2022 6:47 pm
Reputation: 0
Location: England
Status: Offline

Installing a vmdk under QEMU/KVM

Post by martin » Wed Apr 03, 2024 11:30 am

I've just completed a basic installation using QEMU/KVM rather than the documented VirtualBox in the Community License Package email. The enclosed PDF is my write-up for myself, but may be of use to others using QEMU/KVM in a Alma/Rocky/RHEL/Fedora environment.
user vms [Lifeboat].pdf
(37.97 KiB) Downloaded 227 times
Martin
  • Retired System Manager: VMS/UNIX/UNICOS/Linux.
  • Started on a VAX 11/782 in 1984 with VMS 3.6.


hb
Master
Posts: 110
Joined: Mon May 01, 2023 12:11 pm
Reputation: 0
Status: Offline

Re: Installing a vmdk under QEMU/KVM

Post by hb » Wed Apr 03, 2024 12:53 pm

martin wrote:
Wed Apr 03, 2024 11:30 am
I've just completed a basic installation using QEMU/KVM rather than the documented VirtualBox in the Community License Package email. The enclosed PDF is my write-up for myself, but may be of use to others using QEMU/KVM in a Alma/Rocky/RHEL/Fedora environment.user vms [Lifeboat].pdf
You can also convert to qcow2:

Code: Select all

qemu-img convert -O qcow2 community-flat.vmdk $HOSTNAME.qcow2
If the input disk image is not recognized, you can throw a

Code: Select all

-f vmdk
at it .


hajo
Newbie
Posts: 3
Joined: Wed Apr 03, 2024 3:22 pm
Reputation: 0
Location: Germany
Status: Offline

Re: Installing a vmdk under QEMU/KVM

Post by hajo » Wed Apr 03, 2024 5:14 pm

... and you can also use a Linux (i've used Rocky) OS as base.
MicroRSX-11/VMS user/admin since end of 80s retired

User avatar

Topic author
martin
Valued Contributor
Posts: 73
Joined: Tue Mar 22, 2022 6:47 pm
Reputation: 0
Location: England
Status: Offline

Re: Installing a vmdk under QEMU/KVM

Post by martin » Wed Apr 03, 2024 5:47 pm

The instructions ONLY work under Linux, hence "Alma/Rocky/RHEL/Fedora environment". I've not tried them under Debian or Ubuntu so can't guarantee other distros.
Martin
  • Retired System Manager: VMS/UNIX/UNICOS/Linux.
  • Started on a VAX 11/782 in 1984 with VMS 3.6.


dholm
Visitor
Posts: 1
Joined: Wed Apr 03, 2024 8:14 pm
Reputation: 0
Status: Offline

Re: Installing a vmdk under QEMU/KVM

Post by dholm » Wed Apr 03, 2024 8:29 pm

I installed it on Ubuntu 22.04 using this command:

Code: Select all

$ sudo virt-install --name=openvms \
    --machine=q35 \
    --vcpus=2 \
    --memory=6144 \
    --disk=/storage/scratch/libvirt/images/community-flat.vmdk,bus=sata,format=vmdk \
    --boot=uefi,loader=/usr/share/ovmf/OVMF.fd,loader_secure=no \
    --os-variant=generic \
    --graphics=none
The only problem I ran into is that even though I added "loader_secure=no" to the boot argument, UEFI inside the VM still required secure boot. Once I entered the UEFI boot menu and turned off secure boot, everything was great.


ripjsb
Visitor
Posts: 2
Joined: Mon Apr 15, 2024 6:43 pm
Reputation: 0
Status: Offline

Re: Installing a vmdk under QEMU/KVM

Post by ripjsb » Sat Aug 10, 2024 9:09 pm

I was able to boot with the following commands in bare QEMU+KVM:

Code: Select all

$ qemu-img convert -O qcow2 community-flat.vmdk community-flat.qcow2

$ qemu-system-x86_64 -M q35 -accel kvm -cpu host -m 4G -smp 2 \
   -smbios type=0,uefi=on \
   -bios $PATH_TO_UEFI \
   -nic model=e1000e \
   -device ahci,id=sata \
   -drive if=none,id=package,format=qcow2,file=community-flat.qcow2 \
   -device ide-hd,drive=package,bus=sata.0 \
   -serial tcp::4444,server=on,wait=off
On my Debian test machine, the firmware was located at /usr/share/qemu/OVMF.fd

I will also note that substituting the lines pertaining to the disks and controllers the following code causes the OS to bootloop, halting seemingly due to a similar to the problems faced here:
https://forum.vmssoftware.com/viewtopic.php?t=8690

Code: Select all

  -device virtio-scsi,id=scsi \
  -drive if=none,id=package,format=qcow2,file=community-flat.qcow2 \
  -device scsi-hd,drive=package
The error in question:

Code: Select all

%DECnet-W-ZEROLEN, length of file is zero -- SYS$SYSROOT:[SYSEXE]NET$CONFIG.DAT


sms
Master
Posts: 430
Joined: Fri Aug 21, 2020 5:18 pm
Reputation: 0
Status: Offline

Re: Installing a vmdk under QEMU/KVM

Post by sms » Sun Aug 11, 2024 4:23 pm

Code: Select all

> The error in question:
> 
> %DECnet-W-ZEROLEN, length of file is zero --
 SYS$SYSROOT:[SYSEXE]NET$CONFIG.DAT

   I would not expect "<anything>-W-<anything>" to be fatal.

   I got rid of the Community VMDK about as fast as I could, so I know
nothing, and my notes are less than complete, but
SYS$SYSROOT:[SYSEXE]NET$CONFIG.DAT looks to me like one of those Memory
Disk things:

V90 $ dire /size sys$sysdevice:[SYS0.SYSEXE]NET$CONFIG.DAT

Directory SYS$SYSDEVICE:[SYS0.SYSEXE]

NET$CONFIG.DAT;1 -> /SYS$MD24169170352E/SYS0/SYSEXE/NET$CONFIG.DAT
[...]

   That makes examining it a non-trivial task, but I would not be amazed
if the VMDK included a zero-length DECnet configuration file (or none). 

   My notes do show that I got that message when starting a system from
an image backup of that VMDK, but the start-up sailed along happily
thereafter, so I'd've thought that it was harmless.  Like other stuff I
normally ignore:

%JBC-E-OPENERR, error opening SYS$COMMON:[SYSEXE]QMAN$MASTER.DAT;
-RMS-E-FNF, file not found

(which was a "-E-")

or the long version of the DECnet one:

%NET$STARTUP-W-NONETCONFIG, this node has not been configured to run DECnet-Plus
 for OpenVMS
        use SYS$MANAGER:NET$CONFIGURE.COM if you wish to configure DECnet
%NET$STARTUP-I-OPERSTATUS, DECnet-Plus for OpenVMS operational status is OFF
%DECdtm-F-NODECnet, the TP_SERVER process was not started because either:

o  DECnet-Plus is not started or is not configured, or

o  The SYS$NODE_FULLNAME logical name is not defined

   This could be because when you installed DECnet-Plus and were prompted 
   for the system's full name, you specified a local name instead of a 
   DECdns or Domain name.

If you want to use DECdtm services, make sure that DECnet-Plus is started and 
configured and that SYS$NODE_FULLNAME is defined, then use the following 
command to start the TP_SERVER process:

    $ @SYS$STARTUP:DECDTM$STARTUP.COM

   But none of that stuff was fatal.


roberbrooks
VSI Expert
Valued Contributor
Posts: 57
Joined: Thu Jun 20, 2019 11:48 am
Reputation: 0
Status: Offline

Re: Installing a vmdk under QEMU/KVM

Post by roberbrooks » Sun Aug 11, 2024 11:19 pm

> My notes do show that I got that message when starting a system from
> an image backup of that VMDK, but the start-up sailed along happily
> thereafter, so I'd've thought that it was harmless.

Yeah, it is harmless; probably should be an "I" not a "W".

I'm not sure what's going on with that system, but the condition
that causes that message should not prevent a system from
continuing to boot.
--
-- Rob


ripjsb
Visitor
Posts: 2
Joined: Mon Apr 15, 2024 6:43 pm
Reputation: 0
Status: Offline

Re: Installing a vmdk under QEMU/KVM

Post by ripjsb » Mon Aug 12, 2024 11:35 am

My apologies for sharing a misleading error message. Here is the dump of a session with the following config:

Code: Select all

qemu-system-x86_64 -M q35 -accel kvm -cpu host -m 4G -smp 2 \
    -smbios type=0,uefi=on \
    -bios /usr/share/qemu/OVMF.fd \
    -nic model=e1000e \
    -device virtio-scsi,id=scsi\
    -drive if=none,id=package,format=qcow2,file=community-flat.qcow2 \
    -device scsi-hd,drive=package \
    -nographic
 

Code: Select all

[2J[01;01H[=3h[2J[01;01H[2J[01;01H[=3h[2J[01;01H[2J[01;01H[=3h[2J[01;01HBdsDxe: loading Boot0001 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x3,0x0)/Scsi(0x0,0x0)
BdsDxe: starting Boot0001 "UEFI QEMU QEMU HARDDISK " from PciRoot(0x0)/Pci(0x3,0x0)/Scsi(0x0,0x0)

Scanning devices and preparing the OpenVMS Boot Manager Build 136...
[H[2J
VSI OpenVMS Boot Manager: V9.2-x Build 136

  ENABLED:  Symmetric Multi-Processing
  ENABLED:  Crash Dump Processing
  ENABLED:  Console output to Legacy COM 1 Port
  ENABLED:  Using Environment File

  Checking Required Processor Features:
  PASSED

  BOOT MANAGER DEVICE:  DKA0
  DEFAULT BOOT COMMAND: BOOT DKA0 0x00 0x00000000

  VIRTUAL MACHINE GUEST: 
  KVM (tm) No Mouse support; Use Command or Arrow Keys


  CONNECT A REMOTE TERMINAL SESSION NOW.

BOOTMGR> BOOT 
Booting...

%VMS_BOOTMGR-I-HWRPB,   Unable to determine System Serial Number


%%%%%%%%%%% VSI OpenVMS (tm) x86-64 %%%%%%%%%%%



_______________________________________________


      GRAPHICAL OUTPUT HAS BEEN SUSPENDED

      USE A TERMINAL UTILITY FOR ACCESS

_______________________________________________


VSI Primary Kernel SYSBOOT Nov  9 2023 12:17:04


%SYSBOOT-I-VMTYPE, Booting as a KVM (tm) Guest


  

        VMS Software, Inc. OpenVMS (TM) x86_64 Operating System, V9.2-2  
  

                      Copyright 2023 VMS Software, Inc.
  

  
  MDS Mitigation active, variant verw(MD_CLEAR)
  
%DECnet-I-LOADED, network base image loaded, version = 05.92.05
  

  
%DECnet-W-ZEROLEN, length of file is zero -- SYS$SYSROOT:[SYSEXE]NET$CONFIG.DAT
  

%SMP-I-CPUTRN, CPU #1 has joined the active set.
  

  


VSI Dump Kernel SYSBOOT Nov  9 2023 12:17:04

[c7[255;255H[6n8>


**** OpenVMS x86_64 Operating System V9.2-2   - BUGCHECK ****


** Bugcheck code = 0000020D: KRNLSTAKNV, Kernel stack not valid

** Crash Time:            12-AUG-2024 15:33:46.02

** Crash CPU: 00000000    Primary CPU: 00000000    Node Name: V922

** Highest CPU number:    00000001

** Active CPUs:           00000000.00000003

** Current Process:       "SYSINIT"

** Current PSB ID:        00000001

** Image Name:            SYSINIT.EXE


** No useable error log dump file found.

%SYSTEM-F-ACCVIO, access violation, reason mask=04, virtual address=0000000000000010, PC=00000000800068DF, PS=0000001B


  Improperly handled condition, Dump Kernel aborting
    Signal arguments:   Number = 0000000000000005
                        Name   = 000000000000000C
                                 0000000000000004
                                 0000000000000010
                                 00000000800068DF
                                 000000000000001B
    Register dump:
    RAX = 0000000000003600  RDI = 0000000000000080  RSI = 000000007AD18584
    RDX = 0000000000000010  RCX = 0000000000000010  R8  = 0000000000000004
    R9  = FFFFFFFF80CBBF00  RBX = 0000000082000000  RBP = 000000007AD18DF0
    R10 = 000000007AD18584  R11 = FFFFFFFFFFFFFFF5  R12 = 000000000000A300
    R13 = 000000000000A3D0  R14 = 0000000082000000  R15 = 0000000000000000
    RIP = 00000000800068DF  RSP = 000000007AD186E0  SS  = 000000000000001B

                    Call Frame Chain:


                    Depth        RIP

                    ----- -----------------

                    0     00000000.800068DF

                    1     00000000.80004364

                    2     00000000.8005C068

                    3     00000000.7ADFF7FC


  Process activated images:


  Image / Link Time / Type     Start VA           End VA         Image Offset

  ------------------------ ----------------- ----------------- -----------------

  DCL

   9-NOV-2023 12:31:14.27

                      Code 00000000.7AD98000 00000000.7AE4F02F 00000000.80000000

                      Code 00000000.7AEBA000 00000000.7AEBAE17 00000000.0002C000

  SYS$DUMP_KERNEL

   9-NOV-2023 12:31:12.77

                      Code 00000000.80000000 00000000.80062207 00000000.80000000

                      Code 00000000.00018000 00000000.00018267 00000000.00018000

  SYS$DUMP_KERNEL_SHR

   9-NOV-2023 12:30:32.46

                      Code 00000000.80B0C000 00000000.80B0E8EF 00000000.80000000

                      Code 00000000.0011E000 00000000.0011E5F7 00000000.0000A000

  DECC$SHR

   9-NOV-2023 12:30:15.38

                      Code 00000000.80534000 00000000.80971D3F 00000000.80000000

                      Code 00000000.000F0000 00000000.0011564F 00000000.00028000

  DPML$SHR

   9-NOV-2023 12:30:11.76

                      Code 00000000.8019C000 00000000.8024218F 00000000.80000000

                      Code 00000000.0007A000 00000000.00088DB7 00000000.00022000

  CMA$TIS_SHR

   9-NOV-2023 12:30:09.27

                      Code 00000000.8028A000 00000000.8028A0C9 00000000.80000000

                      Code 00000000.8028C000 00000000.8028FB0F 00000000.80002000

                      Code 00000000.00096000 00000000.00097F53 00000000.0000E000

  LIBRTL

   9-NOV-2023 12:30:07.48

                      Code 00000000.802B4000 00000000.802B4597 00000000.80000000

                      Code 00000000.802B6000 00000000.8046267F 00000000.80002000

                      Code 00000000.000C2000 00000000.000C960B 00000000.0002C000

  LIBOTS

   9-NOV-2023 12:30:07.33

                      Code 00000000.80162000 00000000.80162012 00000000.80000000

                      Code 00000000.80164000 00000000.8017408F 00000000.80002000

                      Code 00000000.00058000 00000000.00059EAB 00000000.00004000

  DISMNTSHR

   9-NOV-2023 12:30:13.59

                      Code 00000000.8014A000 00000000.8014B62F 00000000.80000000

                      Code 00000000.8014C000 00000000.801532D7 00000000.80002000

                      Code 00000000.80158000 00000000.8015914F 00000000.8000E000

                      Code 00000000.00054000 00000000.000541C3 00000000.0000E000

  MOUNTSHR

   9-NOV-2023 12:30:13.68

                      Code 00000000.800B6000 00000000.800B709F 00000000.80000000

                      Code 00000000.800B8000 00000000.8010109F 00000000.80002000

                      Code 00000000.8011A000 00000000.8011A42F 00000000.80064000

                      Code 00000000.8011C000 00000000.8013AEE7 00000000.80066000

                      Code 00000000.00046000 00000000.00047123 00000000.0002E000

  SHRIMGMSG

   9-NOV-2023 12:31:28.22

  DECC$MSG

   9-NOV-2023 12:31:15.47


%SYSTEM-W-NOMSG, Message number 00003600
Something has gone wrong. Attempting to restart the system...

Restarting the system...

Post Reply