Skip to content

Commit b0862a4

Browse files
Merge pull request #232558 from msaenzbosupport/patch-7
[Doc-a-THon] Updating OpenBSD VHD
2 parents 07988d0 + 65f89b3 commit b0862a4

File tree

1 file changed

+21
-19
lines changed

1 file changed

+21
-19
lines changed

articles/virtual-machines/linux/create-upload-openbsd.md

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ This article assumes that you have the following items:
2222

2323
* **An Azure subscription** - If you don't have an account, you can create one in just a couple of minutes. If you have an MSDN subscription, see [Monthly Azure credit for Visual Studio subscribers](https://azure.microsoft.com/pricing/member-offers/msdn-benefits-details/). Otherwise, learn how to [create a free trial account](https://azure.microsoft.com/pricing/free-trial/).
2424
* **Azure CLI** - Make sure you have the latest [Azure CLI](/cli/azure/install-azure-cli) installed and logged in to your Azure account with [az login](/cli/azure/reference-index).
25-
* **OpenBSD operating system installed in a .vhd file** - A supported OpenBSD operating system ([6.6 version AMD64](https://ftp.openbsd.org/pub/OpenBSD/6.6/amd64/)) must be installed to a virtual hard disk. Multiple tools exist to create .vhd files. For example, you can use a virtualization solution such as Hyper-V to create the .vhd file and install the operating system. For instructions about how to install and use Hyper-V, see [Install Hyper-V and create a virtual machine](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh846766(v=ws.11)).
25+
* **OpenBSD operating system installed in a .vhd file** - A supported OpenBSD operating system ([6.6 version AMD64](https://ftp.openbsd.org/pub/OpenBSD/7.2/amd64/)) must be installed to a virtual hard disk. Multiple tools exist to create .vhd files. For example, you can use a virtualization solution such as Hyper-V to create the .vhd file and install the operating system. For instructions about how to install and use Hyper-V, see [Install Hyper-V and create a virtual machine](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/hh846766(v=ws.11)).
2626

2727

2828
## Prepare OpenBSD image for Azure
@@ -31,57 +31,59 @@ On the VM where you installed the OpenBSD operating system 6.1, which added Hype
3131
1. If DHCP is not enabled during installation, enable the service as follows:
3232

3333
```sh
34-
echo dhcp > /etc/hostname.hvn0
34+
doas echo dhcp > /etc/hostname.hvn0
3535
```
3636

3737
2. Set up a serial console as follows:
3838

3939
```sh
40-
echo "stty com0 115200" >> /etc/boot.conf
41-
echo "set tty com0" >> /etc/boot.conf
40+
doas echo "stty com0 115200" >> /etc/boot.conf
41+
doas echo "set tty com0" >> /etc/boot.conf
4242
```
4343

4444
3. Configure Package installation as follows:
4545

4646
```sh
47-
echo "https://ftp.openbsd.org/pub/OpenBSD" > /etc/installurl
47+
doas echo "https://ftp.openbsd.org/pub/OpenBSD" > /etc/installurl
4848
```
4949

5050
4. By default, the `root` user is disabled on virtual machines in Azure. Users can run commands with elevated privileges by using the `doas` command on OpenBSD VM. Doas is enabled by default. For more information, see [doas.conf](https://man.openbsd.org/doas.conf.5).
5151

5252
5. Install and configure prerequisites for the Azure Agent as follows:
5353

5454
```sh
55-
pkg_add py-setuptools openssl git
56-
ln -sf /usr/local/bin/python2.7 /usr/local/bin/python
57-
ln -sf /usr/local/bin/python2.7-2to3 /usr/local/bin/2to3
58-
ln -sf /usr/local/bin/python2.7-config /usr/local/bin/python-config
59-
ln -sf /usr/local/bin/pydoc2.7  /usr/local/bin/pydoc
55+
doas pkg_add py-setuptools openssl git
56+
doas ln -sf /usr/local/bin/python2.7 /usr/local/bin/python
57+
doas ln -sf /usr/local/bin/python2.7-2to3 /usr/local/bin/2to3
58+
doas ln -sf /usr/local/bin/python2.7-config /usr/local/bin/python-config
59+
doas ln -sf /usr/local/bin/pydoc2.7 /usr/local/bin/pydoc
6060
```
6161

6262
6. The latest release of the Azure agent can always be found on [GitHub](https://github.com/Azure/WALinuxAgent/releases). Install the agent as follows:
6363

6464
```sh
65-
git clone https://github.com/Azure/WALinuxAgent
66-
cd WALinuxAgent
67-
python setup.py install
68-
waagent -register-service
65+
doas git clone https://github.com/Azure/WALinuxAgent
66+
doas cd WALinuxAgent
67+
doas python setup.py install
68+
doas waagent -register-service
6969
```
7070

7171
> [!IMPORTANT]
7272
> After you install Azure Agent, it's a good idea to verify that it's running as follows:
7373
>
74-
> ```bash
75-
> ps auxw | grep waagent
74+
> ```sh
75+
> doas ps auxw | grep waagent
7676
> root 79309 0.0 1.5 9184 15356 p1 S 4:11PM 0:00.46 python /usr/local/sbin/waagent -daemon (python2.7)
77-
> cat /var/log/waagent.log
77+
> doas cat /var/log/waagent.log
7878
> ```
7979

80-
7. Deprovision the system to clean it and make it suitable for reprovisioning. The following command also deletes the last provisioned user account and the associated data:
80+
7. Deprovision the system to clean it and make it suitable for deprovisioning. The following command also deletes the last provisioned user account and the associated data:
8181

8282
```sh
83-
waagent -deprovision+user -force
83+
doas waagent -deprovision+user -force
8484
```
85+
> [!NOTE]
86+
> If you are migrating a specific virtual machine and do not wish to create a generalized image, skip the deprovision step.
8587

8688
Now you can shut down your VM.
8789

0 commit comments

Comments
 (0)