Azure
Jump To: Support > KB > NetBSD > Azure
NetBSD on Azure
Pre-requisities:
- Create Azure resource group and within it:
- storage account
- network and subnet
- Install VirtualBox
- Install Microsoft Azure Storage Explorer
- Download NetBSD amd64 ISO: NetBSD 10 here
Create disk image using VirtualBox
- Using VirtualBox, click New at top
- Click on Expert Mode at bottom (will be remembered for future VMs you create)
- Enter Name. If you enter
NetBSD
, it will automatically set Type to BSD and Version to NetBSD (64-bit)'' - In ISO Image menu pick Other... and browser to downloaded ISO. In future, this ISO will be on the pull-down menu
- Expand out Hardware section and tick Enable EFI (special OSes only)
- Expand Hard Disk section. Set size as needed (4GB is fine). Pick VHD (Virtal Hard Disk) on Hard Disk File Type and Variant menu. N.B. You must ensure Pre-allocate Full Size is ticked
- Click Finish
- After VM has been created, select it and click Settings
- Go to Serial Ports section and tick Enable Serial Port on Port 1 tab. Set Port Mode to TCP, untick Connect to existing pipe/socket and enter
12345
in Path/Address box. Click OK - Start VM. If prompted for root device, enter
cd0a
and hit return on other options until you reach sysinst menu - Run through installer, select no swap space
- After installation of sets, set root password and create new user (choose to add to wheel group when prompted)
- Enable SSH
- Shutdown and eject ISO image
- Boot VM and login as root
- Add
comsdev=com0
to /boot.cfg - Add
dhcpcd=YES
to /etc/rc.conf - Edit /etc/ssh/sshd_config and set the following (as by default a dormant connection will be dropped after 4 mins by he Azure firewall):
ClientAliveInterval 60 ClientAliveCountMax 3
- Reboot and using PuTTY telnet to localhost on port 12345 to check serial console operation
- Shutdown
In Azure - single VM
- Using Microsoft Azure Storage Explorer, navigate to Disks > Resource group in left-hand side
- Click on Upload, then:
- In Source VHD to C:\Users\USERNAME\Virtualbox VMs\VMNAME and select .vhd file from your Virtualbox VM
- Rename disk in Disk name box as cannot contain spaces, etc.
- Set OS type to Linux
- Pick Location and Availability zone as appropriate and note down what you set as you will need the details later
- Set Hyper-V Generation to V2
- Click Create to upload
- In Azure portal, go to Disks and click on name of uploaded disk
- Click Create VM. Image should already be set to the name of disk
- Enter Virtual machine name
- Depending on what availability zone you picked when uploading the VHD, you will need to pick corresponding settings in the Availability options. If you picked availability zone = None, you will need to select No infrastructure redundancy required here
- Pick appropriate VM size. B1s (1 vcpu, 1GiB) is probably a good start
- On the Select inbound ports menu, check SSH (22) is selected
- Pick Other on the License type menu
- Click through to the Networking section and select the virtual network and subnet if different from the defaults. Choose whether you want a Public IP or not (if not, pick None from the menu). Tick Delete public IP and NIC when VM is deleted.
- Leave everything else as-is and click Review + create
- If all OK, click Create and wait for deployment to complete
- After it has been created, the VM will auto-start. You can click on Go to resource to view the VM and, all being well, you should be able to ssh into the public IP address shown. Depending on the users you created, you may not be able to login, of course
- Alternatively (and definitely if you did not create a public IP address) you can click on Connect when viewing the VM properties, expand out More ways to connect and click on Go to serial console
- After logging in, you can add your ssh public key to
/root/.ssh/authorized_keys
. You can paste text in at the serial console within the Azure portal
In Azure - create image
- Ensure VM is stopped
- On VM overview, click on Capture
- Pick existing or create a new Target Azure computer gallery (e.g. NetBSD)
- Create new Target VM image definition and enter name (e.g. NetBSD-10). You will also need to enter a Publisher, Offer and SKU which can be anything
- The VM will be unusable after an image is created so you may want to tick Automatically delete this virtual machine after creating the image
- Version number has to be in a.b.c syntax, so suggest date of ISO build (e.g. 2023.11.21)
- Click Review + create and then Create
- You can now create VMs from this image. When creating a new VM you can alter the diak size and the machine type (i.e. RAM and vCPUs).
To-do
- Complete port of Linux agent both for ongoing monitoring and VM initialization
- Deal with partition resizing cf. /etc/rc.d/resize_root plus gpt resize
dmesg with B1s VM type
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,
2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
2024
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
NetBSD 10.0_RC2 (GENERIC) #0: Mon Jan 1 14:04:52 UTC 2024
mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC
total memory = 1022 MB
avail memory = 961 MB
timecounter: Timecounters tick every 10.000 msec
Hyper-V Version: 10.0.20348 [SP1]
Features=0x2e7f<VPRUNTIME,TMREFCNT,SYNIC,SYNTM,APIC,HYPERCALL,VPINDEX,REFTSC,IDLE,TMFREQ>
PM Features=0 [C2]
Features3=0xed7b2<DEBUG,XMMHC,IDLE,NUMA,TMFREQ,SYNCMC,CRASH,NPIEP>
Recommends: 00062c2c 00000fff
Limits: Vcpu:240 Lcpu:1024 Int:14880
HW Features: 0000000f, AMD: 00000000
timecounter: Timecounter "Hyper-V" frequency 10000000 Hz quality 2000
timecounter: Timecounter "Hyper-V-TSC" frequency 10000000 Hz quality 3000
Kernelized RAIDframe activated
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
efi: systbl at pa 3ffc4018
mainbus0 (root)
ACPI: RSDP 0x000000003FFFA014 000024 (v02 VRTUAL)
ACPI: XSDT 0x000000003FFF90E8 000064 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: FACP 0x000000003FFF8000 000114 (v06 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: DSDT 0x000000003FFD6000 01E184 (v02 MSFTVM DSDT01 00000001 MSFT 05000000)
ACPI: FACS 0x000000003FFFE000 000040
ACPI: OEM0 0x000000003FFF7000 000064 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: SPCR 0x000000003FFF6000 000050 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: WAET 0x000000003FFF5000 000028 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: APIC 0x000000003FFD5000 000050 (v04 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: SRAT 0x000000003FFD4000 000158 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: BGRT 0x000000003FFD3000 000038 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: FPDT 0x000000003FFD2000 000034 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: 1 ACPI AML tables successfully acquired and loaded
ioapic0 at mainbus0 apid 1: pa 0xfec00000, version 0x11, 24 pins
cpu0 at mainbus0 apid 0
cpu0: Use lfence to serialize rdtsc
cpu0: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz, id 0x406f1
cpu0: node 0, package 0, core 0, smt 0
acpi0 at mainbus0: Intel ACPICA 20221020
acpi0: X/RSDT: OemId <VRTUAL,MICROSFT,00000001>, AslId <MSFT,00000001>
acpi0: SCI interrupting at int 9
timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
VMOD (ACPI0004) at acpi0 not configured
APIC (PNP0003) at acpi0 not configured
vmbus0 at acpi0 (VMBS, VMBUS-0): Hyper-V VMBus
vmbus0: protocol 3.0
"c376c1c3-d276-48d2-90a9-c04748072c60" at vmbus0 not configured
"dynamic-memory" at vmbus0 not configured
"mouse" at vmbus0 not configured
hvkbd0 at vmbus0: Hyper-V Synthetic Keyboard
wskbd0 at hvkbd0 mux 1
genfb0 at vmbus0: Hyper-V Synthetic Video
genfb0: framebuffer at 0x40000000, size 1024x768, depth 32, stride 4096
genfb0: shadow framebuffer enabled, size 3072 KB
wsdisplay0 at genfb0 kbdmux 1
wsmux1: connecting to wsdisplay0
wskbd0: connecting to wsdisplay0
drm at genfb0 not configured
"avma-2" at vmbus0 not configured
hvheartbeat0 at vmbus0: Hyper-V Heartbeat Service
"kvp" at vmbus0 not configured
hvshutdown0 at vmbus0: Hyper-V Guest Shutdown Service
hvtimesync0 at vmbus0: Hyper-V Time Synchronization Service
hvn0 at vmbus0: Hyper-V NetVSC
hvn0: chimney sending buffer 6144/2560
hvn0: RNDIS ver 1.0, aggpkt size 4026531839, aggpkt cnt 8, aggpkt align 8
hvn0: TX aggregate size 6144, pkts 8, align 8
hvn0: NVS 5.0 NDIS 6.30
hvn0: Ethernet address 7c:1e:52:0c:b0:b5
hvs0 at vmbus0: Hyper-V StorVSC SCSI
hvs0: protocol 6.2
scsibus0 at hvs0: 2 targets, 64 luns per target
hvs1 at vmbus0: Hyper-V StorVSC SCSI
hvs1: protocol 6.2
scsibus1 at hvs1: 2 targets, 64 luns per target
com0 at acpi0 (UAR1, PNP0501-1): io 0x3f8-0x3ff irq 4
com0: ns16550a, 16-byte FIFO
com0: console
com1 at acpi0 (UAR2, PNP0501-2): io 0x2f8-0x2ff irq 3
com1: ns16550a, 16-byte FIFO
GENC (HYPER_V_GEN_COUNTER_V1) at acpi0 not configured
ACPI: Enabled 1 GPEs in block 00 to 0F
isa0 at mainbus0
attimer0 at isa0 port 0x40-0x43
acpicpu0 at cpu0: ACPI CPU
acpicpu0: C1: HLT, lat 0 us, pow 0 mW
hyperv0 at cpu0: Hyper-V
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
IPsec: Initialized Security Association Processing.
sd0 at scsibus0 target 1 lun 0: <Msft, Virtual Disk, 1.0> disk fixed
sd0: fabricating a geometry
sd0: 4096 MB, 4096 cyl, 64 head, 32 sec, 512 bytes/sect x 8388608 sectors
sd0: fabricating a geometry
sd0: GPT GUID: 6bbf35be-ec50-4974-a93a-afccf744a81e
dk0 at sd0: "b03841d4-b461-4c3f-9202-c0b6ccbd7583", 262144 blocks at 64, type: msdos
dk1 at sd0: "7ebf8fac-bccc-4670-b84d-cb1f51b81869", 8126336 blocks at 262208, type: ffs
sd1 at scsibus0 target 1 lun 1: <Msft, Virtual Disk, 1.0> disk fixed
sd1: fabricating a geometry
sd1: 4096 MB, 4096 cyl, 64 head, 32 sec, 512 bytes/sect x 8388608 sectors
sd1: fabricating a geometry
sd0: async, 8-bit transfers, tagged queueing
sd1: async, 8-bit transfers, tagged queueing
swwdog0: software watchdog initialized
boot device: sd0
root on dk1
root file system type: ffs
kern.module.path=/stand/amd64/10.0/modules
WARNING: NVRAM century is 51 but RTC year is 2024
wsdisplay0: screen 1 added (default, vt100 emulation)
wsdisplay0: screen 2 added (default, vt100 emulation)
wsdisplay0: screen 3 added (default, vt100 emulation)
wsdisplay0: screen 4 added (default, vt100 emulation)
2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,
2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023,
2024
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.
NetBSD 10.0_RC2 (GENERIC) #0: Mon Jan 1 14:04:52 UTC 2024
mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/amd64/compile/GENERIC
total memory = 1022 MB
avail memory = 961 MB
timecounter: Timecounters tick every 10.000 msec
Hyper-V Version: 10.0.20348 [SP1]
Features=0x2e7f<VPRUNTIME,TMREFCNT,SYNIC,SYNTM,APIC,HYPERCALL,VPINDEX,REFTSC,IDLE,TMFREQ>
PM Features=0 [C2]
Features3=0xed7b2<DEBUG,XMMHC,IDLE,NUMA,TMFREQ,SYNCMC,CRASH,NPIEP>
Recommends: 00062c2c 00000fff
Limits: Vcpu:240 Lcpu:1024 Int:14880
HW Features: 0000000f, AMD: 00000000
timecounter: Timecounter "Hyper-V" frequency 10000000 Hz quality 2000
timecounter: Timecounter "Hyper-V-TSC" frequency 10000000 Hz quality 3000
Kernelized RAIDframe activated
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
efi: systbl at pa 3ffc4018
mainbus0 (root)
ACPI: RSDP 0x000000003FFFA014 000024 (v02 VRTUAL)
ACPI: XSDT 0x000000003FFF90E8 000064 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: FACP 0x000000003FFF8000 000114 (v06 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: DSDT 0x000000003FFD6000 01E184 (v02 MSFTVM DSDT01 00000001 MSFT 05000000)
ACPI: FACS 0x000000003FFFE000 000040
ACPI: OEM0 0x000000003FFF7000 000064 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: SPCR 0x000000003FFF6000 000050 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: WAET 0x000000003FFF5000 000028 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: APIC 0x000000003FFD5000 000050 (v04 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: SRAT 0x000000003FFD4000 000158 (v02 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: BGRT 0x000000003FFD3000 000038 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: FPDT 0x000000003FFD2000 000034 (v01 VRTUAL MICROSFT 00000001 MSFT 00000001)
ACPI: 1 ACPI AML tables successfully acquired and loaded
ioapic0 at mainbus0 apid 1: pa 0xfec00000, version 0x11, 24 pins
cpu0 at mainbus0 apid 0
cpu0: Use lfence to serialize rdtsc
cpu0: Intel(R) Xeon(R) CPU E5-2673 v4 @ 2.30GHz, id 0x406f1
cpu0: node 0, package 0, core 0, smt 0
acpi0 at mainbus0: Intel ACPICA 20221020
acpi0: X/RSDT: OemId <VRTUAL,MICROSFT,00000001>, AslId <MSFT,00000001>
acpi0: SCI interrupting at int 9
timecounter: Timecounter "ACPI-Fast" frequency 3579545 Hz quality 1000
VMOD (ACPI0004) at acpi0 not configured
APIC (PNP0003) at acpi0 not configured
vmbus0 at acpi0 (VMBS, VMBUS-0): Hyper-V VMBus
vmbus0: protocol 3.0
"c376c1c3-d276-48d2-90a9-c04748072c60" at vmbus0 not configured
"dynamic-memory" at vmbus0 not configured
"mouse" at vmbus0 not configured
hvkbd0 at vmbus0: Hyper-V Synthetic Keyboard
wskbd0 at hvkbd0 mux 1
genfb0 at vmbus0: Hyper-V Synthetic Video
genfb0: framebuffer at 0x40000000, size 1024x768, depth 32, stride 4096
genfb0: shadow framebuffer enabled, size 3072 KB
wsdisplay0 at genfb0 kbdmux 1
wsmux1: connecting to wsdisplay0
wskbd0: connecting to wsdisplay0
drm at genfb0 not configured
"avma-2" at vmbus0 not configured
hvheartbeat0 at vmbus0: Hyper-V Heartbeat Service
"kvp" at vmbus0 not configured
hvshutdown0 at vmbus0: Hyper-V Guest Shutdown Service
hvtimesync0 at vmbus0: Hyper-V Time Synchronization Service
hvn0 at vmbus0: Hyper-V NetVSC
hvn0: chimney sending buffer 6144/2560
hvn0: RNDIS ver 1.0, aggpkt size 4026531839, aggpkt cnt 8, aggpkt align 8
hvn0: TX aggregate size 6144, pkts 8, align 8
hvn0: NVS 5.0 NDIS 6.30
hvn0: Ethernet address 7c:1e:52:0c:b0:b5
hvs0 at vmbus0: Hyper-V StorVSC SCSI
hvs0: protocol 6.2
scsibus0 at hvs0: 2 targets, 64 luns per target
hvs1 at vmbus0: Hyper-V StorVSC SCSI
hvs1: protocol 6.2
scsibus1 at hvs1: 2 targets, 64 luns per target
com0 at acpi0 (UAR1, PNP0501-1): io 0x3f8-0x3ff irq 4
com0: ns16550a, 16-byte FIFO
com0: console
com1 at acpi0 (UAR2, PNP0501-2): io 0x2f8-0x2ff irq 3
com1: ns16550a, 16-byte FIFO
GENC (HYPER_V_GEN_COUNTER_V1) at acpi0 not configured
ACPI: Enabled 1 GPEs in block 00 to 0F
isa0 at mainbus0
attimer0 at isa0 port 0x40-0x43
acpicpu0 at cpu0: ACPI CPU
acpicpu0: C1: HLT, lat 0 us, pow 0 mW
hyperv0 at cpu0: Hyper-V
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
IPsec: Initialized Security Association Processing.
sd0 at scsibus0 target 1 lun 0: <Msft, Virtual Disk, 1.0> disk fixed
sd0: fabricating a geometry
sd0: 4096 MB, 4096 cyl, 64 head, 32 sec, 512 bytes/sect x 8388608 sectors
sd0: fabricating a geometry
sd0: GPT GUID: 6bbf35be-ec50-4974-a93a-afccf744a81e
dk0 at sd0: "b03841d4-b461-4c3f-9202-c0b6ccbd7583", 262144 blocks at 64, type: msdos
dk1 at sd0: "7ebf8fac-bccc-4670-b84d-cb1f51b81869", 8126336 blocks at 262208, type: ffs
sd1 at scsibus0 target 1 lun 1: <Msft, Virtual Disk, 1.0> disk fixed
sd1: fabricating a geometry
sd1: 4096 MB, 4096 cyl, 64 head, 32 sec, 512 bytes/sect x 8388608 sectors
sd1: fabricating a geometry
sd0: async, 8-bit transfers, tagged queueing
sd1: async, 8-bit transfers, tagged queueing
swwdog0: software watchdog initialized
boot device: sd0
root on dk1
root file system type: ffs
kern.module.path=/stand/amd64/10.0/modules
WARNING: NVRAM century is 51 but RTC year is 2024
wsdisplay0: screen 1 added (default, vt100 emulation)
wsdisplay0: screen 2 added (default, vt100 emulation)
wsdisplay0: screen 3 added (default, vt100 emulation)
wsdisplay0: screen 4 added (default, vt100 emulation)