You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/virtual-machines/linux/create-upload-ubuntu.md
+37-33Lines changed: 37 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,10 +31,11 @@ This article assumes that you've already installed an Ubuntu Linux operating sys
31
31
* All VHDs on Azure must have a virtual size aligned to 1MB. When converting from a raw disk to VHD you must ensure that the raw disk size is a multiple of 1MB before conversion. See [Linux Installation Notes](create-upload-generic.md#general-linux-installation-notes) for more information.
32
32
33
33
## Manual steps
34
+
34
35
> [!NOTE]
35
36
> Before attempting to create your own custom Ubuntu image for Azure, please consider using the pre-built and tested images from [https://cloud-images.ubuntu.com/](https://cloud-images.ubuntu.com/) instead.
36
-
>
37
-
>
37
+
>
38
+
38
39
39
40
1. In the center pane of Hyper-V Manager, select the virtual machine.
40
41
@@ -44,13 +45,13 @@ This article assumes that you've already installed an Ubuntu Linux operating sys
44
45
45
46
Before editing `/etc/apt/sources.list`, it's recommended to make a backup:
5. Modify the kernel boot line forGrub to include additional kernel parameters for Azure. To do this open `/etc/default/grub`in a text editor, find the variable called `GRUB_CMDLINE_LINUX_DEFAULT` (or add it if needed) and edit it to include the following parameters:
@@ -80,7 +83,7 @@ This article assumes that you've already installed an Ubuntu Linux operating sys
80
83
81
84
7. Install cloud-init (the provisioning agent) and the Azure Linux Agent (the guest extensions handler). Cloud-init uses `netplan` to configure the system network configuration (during provisioning and each subsequent boot) and `gdisk` to partition resource disks.
@@ -131,13 +134,15 @@ This article assumes that you've already installed an Ubuntu Linux operating sys
131
134
132
135
10. Configure the Azure Linux agent to rely on cloud-init to perform provisioning. Have a look at the [WALinuxAgent project](https://github.com/Azure/WALinuxAgent) for more information on these options.
133
136
134
-
```console
135
-
sed -i 's/Provisioning.Enabled=y/Provisioning.Enabled=n/g' /etc/waagent.conf
136
-
sed -i 's/Provisioning.UseCloudInit=n/Provisioning.UseCloudInit=y/g' /etc/waagent.conf
137
-
sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
138
-
sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
137
+
```bash
138
+
sudo sed -i 's/Provisioning.Enabled=y/Provisioning.Enabled=n/g' /etc/waagent.conf
139
+
sudo sed -i 's/Provisioning.UseCloudInit=n/Provisioning.UseCloudInit=y/g' /etc/waagent.conf
140
+
sudo sed -i 's/ResourceDisk.Format=y/ResourceDisk.Format=n/g' /etc/waagent.conf
141
+
sudo sed -i 's/ResourceDisk.EnableSwap=y/ResourceDisk.EnableSwap=n/g' /etc/waagent.conf
142
+
```
139
143
140
-
cat >> /etc/waagent.conf << EOF
144
+
```bash
145
+
sudo cat >> /etc/waagent.conf << EOF
141
146
# For Azure Linux agent version >= 2.2.45, this is the option to configure,
142
147
# enable, or disable the provisioning behavior of the Linux agent.
143
148
# Accepted values are auto (default), waagent, cloud-init, or disabled.
@@ -149,7 +154,7 @@ This article assumes that you've already installed an Ubuntu Linux operating sys
149
154
150
155
11. Clean cloud-init and Azure Linux agent runtime artifacts and logs:
151
156
152
-
```console
157
+
```bash
153
158
sudo cloud-init clean --logs --seed
154
159
sudo rm -rf /var/lib/cloud/
155
160
sudo systemctl stop walinuxagent.service
@@ -165,11 +170,10 @@ This article assumes that you've already installed an Ubuntu Linux operating sys
165
170
> [!WARNING]
166
171
> Deprovisioning using the command above does not guarantee that the image is cleared of all sensitive information and is suitable for redistribution.
0 commit comments