Skip to content

Commit b3df90b

Browse files
Update linux-hyperv-issue.md
1 parent 111041a commit b3df90b

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

support/azure/virtual-machines/linux/linux-hyperv-issue.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ Or
6767
1. Identify the file that disables the hv_netvsc driver and the corresponding line numbers by running the following command:
6868

6969
```bash
70-
grep -nr "hv_netvsc" /etc/modprobe.d/
70+
sudo grep -nr "hv_netvsc" /etc/modprobe.d/
7171
```
7272

7373
2. Modify the corresponding file and comment out or delete the hv_netvsc entries:
7474

7575
:::image type="content" source="media/linux-hyperv-issue/hv-netvsc-disabled.png" alt-text="Screenshot that shows the possible configuration file contents used to disable network drivers.":::
7676

7777
```bash
78-
vi /etc/modprobe.d/disable.conf
78+
sudo vi /etc/modprobe.d/disable.conf
7979
```
8080

8181
> [!NOTE]
@@ -88,13 +88,13 @@ Or
8888
- For RHEL/SLES-based images
8989

9090
```bash
91-
# dracut -f -v
91+
sudo dracut -f -v
9292
```
9393

9494
- For Ubuntu/Debian-based images
9595

9696
```bash
97-
# mkinitramfs -k -o /boot/initrd.img-$(uname -r)
97+
sudo mkinitramfs -k -o /boot/initrd.img-$(uname -r)
9898
```
9999

100100
6. Reboot the VM.
@@ -104,19 +104,19 @@ Always take a backup of the original initial RAMdisk image to facilitate the rol
104104
- For RHEL-based images:
105105

106106
```bash
107-
# cp /boot/initramfs-<kernelVersion>.img /boot/initramfs-<kernelVersion>.img.bak
107+
sudo cp /boot/initramfs-<kernelVersion>.img /boot/initramfs-<kernelVersion>.img.bak
108108
```
109109

110110
- For SLES-based images:
111111

112112
```bash
113-
# cp /boot/initrd-<kernelVersion> /boot/initrd-<kernelVersion>.bak
113+
sudo cp /boot/initrd-<kernelVersion> /boot/initrd-<kernelVersion>.bak
114114
```
115115

116116
- For Ubuntu/Debian-based images:
117117

118118
```bash
119-
# cp /boot/initrd.img-<kernelVersion> /boot/initrd.img-<kernelVersion>.bak
119+
sudo cp /boot/initrd.img-<kernelVersion> /boot/initrd.img-<kernelVersion>.bak
120120
```
121121

122122
### <a id="reenable-hv_netvsc-offline"></a>Solution 2: Enable Hyper-V network driver offline
@@ -154,7 +154,7 @@ If the issue continues even though the Hyper-V network driver is enabled, use on
154154
7. Generally, a NIC MAC address would only change if a NIC is deleted or added by the administrator or a NIC is updated in the backend. If network configuration via cloud-init isn't desired, and the `apply_network_config` parameter needs to be set to false, delete the */var/lib/cloud/instance/obj.pkl* file and reboot the system.
155155

156156
```bash
157-
# rm /var/lib/cloud/instance/obj.pkl
157+
sudo rm /var/lib/cloud/instance/obj.pkl
158158
```
159159

160160
8. Once the changes are applied, restart the system.
@@ -213,7 +213,7 @@ If the VM is inaccessible due to other Hyper-V drivers being disabled, use an of
213213
1. Run the following command to identify the file that disables the hv_utils, hv_vmbus, hv_storvsc, or hv_netvsc driver and the corresponding line number.
214214
215215
```bash
216-
egrep -nr "hv_utils|hv_vmbus|hv_storvsc|hv_netvsc" /etc/modprobe.d/
216+
sudo egrep -nr "hv_utils|hv_vmbus|hv_storvsc|hv_netvsc" /etc/modprobe.d/
217217
```
218218
219219
2. Modify the corresponding file and comment out or delete the hv_utils, hv_vmbus, hv_storvsc, or hv_netvsc entries. The entries will most commonly be any of the following (or both):
@@ -223,7 +223,7 @@ If the VM is inaccessible due to other Hyper-V drivers being disabled, use an of
223223
:::image type="content" source="media/linux-hyperv-issue/hv-disabled-example-2.png" alt-text="Screenshot that shows the possible configuration file contents used to disable kernel modules/drivers.":::
224224
225225
```bash
226-
vi /etc/modprobe.d/disable.conf
226+
sudo vi /etc/modprobe.d/disable.conf
227227
```
228228
229229
> [!IMPORTANT]
@@ -236,13 +236,13 @@ If the VM is inaccessible due to other Hyper-V drivers being disabled, use an of
236236
- For RHEL/SLES-based images
237237
238238
```bash
239-
# dracut -f -v
239+
sudo dracut -f -v
240240
```
241241
242242
- For Ubuntu/Debian-based images
243243
244244
```bash
245-
# mkinitramfs -k -o /boot/initrd.img-$(uname -r)
245+
sudo mkinitramfs -k -o /boot/initrd.img-$(uname -r)
246246
```
247247
248248
5. Once the changes are applied, use the `az vm repair restore` command to perform an automatic OS disk swap with the original VM and reboot the system.

0 commit comments

Comments
 (0)