DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 1st August 2016
gpatrick gpatrick is offline
Package Pilot
 
Join Date: Nov 2009
Posts: 187
Default OpenBSD's new vm

What is required to add to the kernel in order to try using the new vm? I only receive errors telling me the device doesn't exist and I can't seem to find what options or devices to add to the kernel to rebuild it to at least test it.
Reply With Quote
  #2   (View Single Post)  
Old 1st August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,370
Default

  1. It is still in development, and not production ready, which is why it is disabled by default.
  2. You may experiment, of course, but be aware that development is a moving target, features may or may not work at any given point in time.
  3. Issues or problems that occur when using a custom kernel must be replicated with a GENERIC kernel in order to report them. (Bugs in vmm(4) uncovered by testing on an up to date -current system would be reported directly to Mike Larkin, who leads the development effort.)
Enable by:
  • Copying GENERIC/GENERIC.MP to new configuration files, since you will be building a custom kernel. The instructions below assume you are using VMM and VMM.MP, though the choice of name is yours.
  • Modifying VMM.MP to include VMM rather than GENERIC.
  • Modifying VMM and uncomment the vmm(4) driver. See the SYNOPSIS section of the driver's man page.
  • Configuring and building the VMM.MP kernel.
  • Storing the resulting "bsd" kernel file in the root directory. For testing, using a different file name such as /vmm.
  • Selecting the test custom kernel at the boot> prompt, by typing its name, such as "vmm".

Last edited by jggimi; 1st August 2016 at 11:57 PM. Reason: grammar
Reply With Quote
  #3   (View Single Post)  
Old 5th August 2016
gpatrick gpatrick is offline
Package Pilot
 
Join Date: Nov 2009
Posts: 187
Default

Thank you. I've successfully built a kernel with vmm and it has started the vm.
Code:
# ps auxww|grep vmd
_vmd   83094  99.0  0.2  525924  12872  ??  R    2:06PM   8:42.71  vmd:  vm2.example.com (vmd)
root  2327  0.0  0.0  1184  1388  ??   Isp   2:06PM    0:00.00  /usr/sbin/vmd
_vmd   53428 0.0  0.0  1096  1212  ??  Ip   2:06PM   0:00.00  vmd: control (vmd)
_vmd       99  0.0  0.0  1100  1526  ??  I    2:06PM    0:00.00  vmd: vmm (vmd)
Next question.
How do I get a console or enter the vm? Unless I missed it in the manpage I cannot find out how.
Reply With Quote
  #4   (View Single Post)  
Old 5th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,370
Default

  1. Use vmctl(8) start -c.
  2. Use vmctl(8) console.
  3. Use cu(1) directly.
Reply With Quote
  #5   (View Single Post)  
Old 5th August 2016
gpatrick gpatrick is offline
Package Pilot
 
Join Date: Nov 2009
Posts: 187
Default

Thanks again. I'll wait for it to stabilize.

Code:
# vmctl console vm2.example.com
Connected to /dev/ttyp0 (speed 9600)

ddb>
Reply With Quote
  #6   (View Single Post)  
Old 5th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,370
Default

You haven't posted any details about the host or the guest, so I can't offer any further advice.
Reply With Quote
  #7   (View Single Post)  
Old 5th August 2016
gpatrick gpatrick is offline
Package Pilot
 
Join Date: Nov 2009
Posts: 187
Default

Code:
OpenBSD 6.0-current (VMM) #0: Fri Aug  5 14:03:22 CDT 2016
    root@dsg14.local:/usr/src/sys/arch/amd64/compile/VMM
real mem = 6286077952 (5994MB)
avail mem = 6091120640 (5808MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0xeb7d0 (25 entries)
bios0: vendor AMI version "8.06" date 08/15/2012
bios0: Hewlett-Packard p2-1394
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC FPDT MCFG MSDM HPET SSDT SSDT SSDT DBGP
acpi0: wakeup devices PS2K(S3) PS2M(S3) P0P1(S4) USB1(S3) USB2(S3) USB3(S3) USB4(S3) USB5(S3) USB6(S3) USB7(S3) PXSX(S4) RP01(S4) PXSX(S4) RP02(S4) PXSX(S4) RP03(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i3-2120T CPU @ 2.60GHz, 2594.54 MHz
cpu0: FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC,SENSOR,ARAT
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1, IBE
cpu at mainbus0: not configured
cpu at mainbus0: not configured
cpu at mainbus0: not configured
ioapic0 at mainbus0: apid 0 pa 0xfec00000, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xf8000000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P1)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus -1 (RP02)
acpiprt4 at acpi0: bus -1 (RP03)
acpiprt5 at acpi0: bus -1 (RP04)
acpiprt6 at acpi0: bus -1 (RP05)
acpiprt7 at acpi0: bus 2 (RP06)
acpiprt8 at acpi0: bus -1 (RP07)
acpiprt9 at acpi0: bus -1 (RP08)
acpiprt10 at acpi0: bus -1 (PEG0)
acpiec0 at acpi0: not present
acpicpu0 at acpi0: C3(350@104 mwait.1@0x20), C2(500@80 mwait.1@0x10), C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: FN00, resource for FAN0
acpipwrres1 at acpi0: FN01, resource for FAN1
acpipwrres2 at acpi0: FN02, resource for FAN2
acpipwrres3 at acpi0: FN03, resource for FAN3
acpipwrres4 at acpi0: FN04, resource for FAN4
acpitz0 at acpi0: critical temperature is 86 degC
acpitz1 at acpi0: critical temperature is 86 degC
"INT3F0D" at acpi0 not configured
acpibtn0 at acpi0: PWRB
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
"PNP0C0B" at acpi0 not configured
acpivideo0 at acpi0: GFX0
acpivout0 at acpivideo0: DD02
cpu0: Enhanced SpeedStep 2594 MHz: speeds: 2600, 2500, 2400, 2300, 2200, 2100, 2000, 1900, 1800, 1700, 1600 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 2G Host" rev 0x09
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 2000" rev 0x09
drm0 at inteldrm0
inteldrm0: msi
inteldrm0: 1366x768
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 6 Series MEI" rev 0x04 at pci0 dev 22 function 0 not configured
ehci0 at pci0 dev 26 function 0 "Intel 6 Series USB" rev 0x05: apic 0 int 16
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 function 0 "Intel 6 Series HD Audio" rev 0x05: msi
azalia0: codecs: Realtek ALC662
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 6 Series PCIE" rev 0xb5: msi
pci1 at ppb0 bus 1
ppb1 at pci0 dev 28 function 5 "Intel 6 Series PCIE" rev 0xb5: msi
pci2 at ppb1 bus 2
alc0 at pci2 dev 0 function 0 "Attansic Technology L2C" rev 0xc1: msi, address 4c:72:b9:9d:9c:55
atphy0 at alc0 phy 0: F2 10/100 PHY, rev. 5
ehci1 at pci0 dev 29 function 0 "Intel 6 Series USB" rev 0x05: apic 0 int 23
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 "Intel EHCI root hub" rev 2.00/1.00 addr 1
pcib0 at pci0 dev 31 function 0 "Intel H61 LPC" rev 0x05
ahci0 at pci0 dev 31 function 2 "Intel 6 Series AHCI" rev 0x05: msi, AHCI 1.3
ahci0: port 0: 3.0Gb/s
ahci0: port 1: 1.5Gb/s
ahci0: PHY offline on port 4
ahci0: PHY offline on port 5
scsibus1 at ahci0: 32 targets
sd0 at scsibus1 targ 0 lun 0: <ATA, Hitachi HDS72101, JP4O> SCSI3 0/direct fixed naa.5000cca39af58ba5
sd0: 953869MB, 512 bytes/sector, 1953525168 sectors
cd0 at scsibus1 targ 1 lun 0: <hp, DVD A DH16ACSHR, JHG6> ATAPI 5/cdrom removable
ichiic0 at pci0 dev 31 function 3 "Intel 6 Series SMBus" rev 0x05: apic 0 int 18
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 2GB DDR3 SDRAM PC3-12800
spdmem1 at iic0 addr 0x52: 4GB DDR3 SDRAM PC3-12800
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
vmm0 at mainbus0: VMX/EPT
uhub2 at uhub0 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
axe0 at uhub2 port 3 configuration 1 interface 0 "ASIX Electronics AX88772" rev 2.00/0.01 addr 3
axe0: AX88772, address 68:7f:74:4c:be:73
ukphy0 at axe0 phy 16: Generic IEEE 802.3u media interface, rev. 1: OUI 0x000ec6, model 0x0006
axe1 at uhub2 port 4 configuration 1 interface 0 "ASIX Electronics AX88772" rev 2.00/0.01 addr 4
axe1: AX88772, address 68:7f:74:95:4a:84
ukphy1 at axe1 phy 16: Generic IEEE 802.3u media interface, rev. 1: OUI 0x000ec6, model 0x0006
uhub3 at uhub1 port 1 "Intel Rate Matching Hub" rev 2.00/0.00 addr 2
axe2 at uhub3 port 2 configuration 1 interface 0 "ASIX Electronics AX88772" rev 2.00/0.01 addr 3
axe2: AX88772, address 00:25:9c:3e:9b:a0
ukphy2 at axe2 phy 16: Generic IEEE 802.3u media interface, rev. 1: OUI 0x000ec6, model 0x0006
uhidev0 at uhub3 port 3 configuration 1 interface 0 "Logitech Optical USB Mouse" rev 2.00/3.40 addr 4
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons
wsmouse0 at ums0 mux 0
uhidev1 at uhub3 port 4 configuration 1 interface 0 "Lite-On Technology Corp. USB Keyboard" rev 1.10/1.09 addr 5
uhidev1: iclass 3/1
ukbd0 at uhidev1: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
wskbd1: connecting to wsdisplay0
uhidev2 at uhub3 port 4 configuration 1 interface 1 "Lite-On Technology Corp. USB Keyboard" rev 1.10/1.09 addr 5
uhidev2: iclass 3/0, 2 report ids
uhid0 at uhidev2 reportid 1: input=2, output=0, feature=0
uhid1 at uhidev2 reportid 2: input=1, output=0, feature=0
umass0 at uhub3 port 6 configuration 1 interface 0 "Generic USB2.0-CRW" rev 2.00/58.88 addr 6
umass0: using SCSI over Bulk-Only
scsibus2 at umass0: 2 targets, initiator 0
sd1 at scsibus2 targ 1 lun 0: <Generic-, Multi-Card, 1.00> SCSI0 0/direct removable serial.0bda0158114173400000
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
root on sd0a (a18de9b3e066ec60.a) swap on sd0b dump on sd0b
WARNING: / was not properly unmounted
Reply With Quote
  #8   (View Single Post)  
Old 6th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,370
Default

Thank you for posting host information. It looks fine, but doesn't provide any information about your guest.

Here is an excerpted console log of installing and running an OpenBSD guest. Two VMs are created and started. The first uses a RAMDISK kernel to conduct the install, then the first VM is stopped and the second VM loads the GENERIC kernel.
  1. I've reduced the full output to fit in the thread.
  2. I instructed the install script to provision a 9600 baud serial console. This sets /etc/ttys and /etc/boot.conf accordingly. The ramdisk kernel doesn't seem to need this in the VM environment, and that is likely intentional. At this time, the GENERIC kernel apparently still does.
  3. The virtual machines are amd64, 256MB RAM.
  4. I used "~." as a new line of text (after a previous Enter key) to exit cu(1). The console log displays "[EOT]".
  5. My installed filesets were only two kernels and base60.tgz, which were locally available to me. I used mkhybrid(1) to produce a CD9660 filesystem so I could install without needing a vio(4) network interface.
Code:
# vmctl create vm.drive -s 2g
vmctl: imagefile created
# ls -lh
total 144648
-rw-r--r--  1 josh  wheel  52.8M Aug  5 20:04 base60.tgz
-rw-r--r--  1 josh  wheel  10.0M Aug  5 19:58 bsd
-rw-r--r--  1 josh  wheel   7.5M Aug  5 19:59 bsd.rd
-rw-r--r--  1 root  wheel   103B Aug  5 20:03 typescript
-rw-------  1 root  wheel   2.0G Aug  5 20:02 vm.drive
# mkhybrid -o file.sets -R bsd bsd.rd.base60.tgz
 13.86% done, estimate finish Fri Aug  5 20:05:13 2016
 27.75% done, estimate finish Fri Aug  5 20:05:16 2016
 41.59% done, estimate finish Fri Aug  5 20:05:15 2016
 55.48% done, estimate finish Fri Aug  5 20:05:14 2016
 69.32% done, estimate finish Fri Aug  5 20:05:14 2016
 83.23% done, estimate finish Fri Aug  5 20:05:14 2016
 97.06% done, estimate finish Fri Aug  5 20:05:14 2016
Total translation table size: 0
Total rockridge attributes bytes: 404
Total directory bytes: 0
Path table size(bytes): 10
Max brk space used 0
36063 extents written (70 Mb)
# vmd
# vmctl start install -c -k bsd.rd -m 256m -d vm.drive -d file.sets
vmctl: starting without network interfaces
Connected to /dev/ttyp4 (speed 9600)
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2016 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 6.0-current (RAMDISK_CD) #2104: Fri Aug     5 16:13:30 MDT 2016
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/RAMDISK_CD
RTC BIOS diagnostic error 20<config_unit>
real mem = 251658240 (240MB)
avail mem = 242438144 (231MB)
mainbus0 at root
.
.
.
What timezone are you in? ('?' for list) [Canada/Mountain] US/Eastern
Saving configuration files...done.
Making all device nodes...done.

CONGRATULATIONS! Your OpenBSD install has been successfully completed!
To boot the new system, enter 'reboot' at the command prompt.
When you login to your new system the first time, please read your mail
using the 'mail' command.

# halt 
syncing disks... done

The operating system has halted.
Please press any key to reboot.


[EOT]
# vmctl stop install
vmctl: terminated vm 1 successfully
# vmctl start run -c -k bsd -m 256m -d vm.drive
vmctl: starting without network interfaces
Connected to /dev/ttyp4 (speed 9600)
[ using 1206864 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2016 OpenBSD. All rights reserved.  http://www.OpenBSD.org

OpenBSD 6.0-current (GENERIC) #2152: Fri Aug  5 16:03:00 MDT 2016
    deraadt@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC
RTC BIOS diagnostic error 20<config_unit>
real mem = 251658240 (240MB)
avail mem = 239726592 (228MB)
mpath0 at root
.
.
.
clearing /tmp
kern.securelevel: 0 -> 1
creating runtime link editor directory cache.
preserving editor files.
starting network daemons: smtpd sndiod.
Path to firmware: http://firmware.openbsd.org/firmware/snapshots/
No devices found which need firmware files to be downloaded.
starting local daemons: cron.
Fri Aug     5 18:11:24 EDT 2016

OpenBSD/amd64 (foo.local) (tty00)

login:
[EOT]
# vmctl stop run
vmctl: terminated vm 2 successfully
#

Last edited by jggimi; 6th August 2016 at 03:32 PM. Reason: typo
Reply With Quote
  #9   (View Single Post)  
Old 9th August 2016
gpatrick gpatrick is offline
Package Pilot
 
Join Date: Nov 2009
Posts: 187
Default

I was able to successfully build a VM with an interface that was configured, however, it didn't have any network connectivity. Is that piece still a work in progress?
Reply With Quote
Old 10th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,370
Default

I don't know. It's worked fine for me previously, but as I've mentioned, vmm is still considered experimental. You might reach out to the development team, as discussed above.
Reply With Quote
Old 18th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,370
Default

Two updates were made yesterday to the vmctl(8) man page to begin documenting VM networking. Here's the first of the two.

http://marc.info/?l=openbsd-cvs&m=147147882624198&w=2
Reply With Quote
Old 18th August 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,370
Default

And, here is a diff containing both commits: http://cvsweb.openbsd.org/cgi-bin/cv...1=1.10&r2=1.12
Reply With Quote
Old 3rd September 2016
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 5,370
Default

I happened to set up a vmm lab for some network configuration testing, using a freshly built -current system, and networking was working for me.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 04:11 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick