LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Slackware 14.1 in MS Hyper-V (https://www.linuxquestions.org/questions/slackware-14/slackware-14-1-in-ms-hyper-v-4175486298/)

skush 11-29-2013 07:03 PM

Slackware 14.1 in MS Hyper-V
 
I'm having trouble with Slackware 14.1 in Hyper-V, it gets through the installer just fine, and reboots, and LILO works fine. After selecting it from the LILO menu however, it goes through some of the regular boot procedure (Loading Linux…….., etc.) then it goes to a kernel panic. Does anyone else have a successful installation on Hyper-V? Should I not be using the default kernel? Do I need to give certain kernel parameters when it asks? The hypervisor is running Windows Server 2008. I can post an image of the panic the next time I have access to the machine if necessary.

Thanks

tux_dude 11-30-2013 10:05 AM

Are you using initrd and if yes, what options did you specify?

mostlyharmless 11-30-2013 10:48 AM

There's a hyper-v compatibility option for the kernel compile options which is not selected by default. Methinks you need to recompile the kernel.

CeeWave 12-01-2013 04:54 PM

I have recently installed a Slackware64 guest virtual machine in a Windows 8 host with Hyper-V. I ran into similar problems finding the root device when booting either the huge or generic 3.10.17 kernels. I was able to successfully boot the virtual machine, with the stock kernels, by using an initrd image that included the hv_vmbus and hv_storvsc modules. These modules are in addition to any filesystem modules that you would normally require for use when booting with the generic kernel.

skush 12-02-2013 07:44 PM

initrd
 
Thanks for the replies. CeeWave, as I have zero experience with initrd, could you explain the process you went through a little bit more. Thanks.

CeeWave 12-03-2013 07:14 AM

This may not be the cleanest method, and I'm recalling the process mostly from memory, but the basic steps I used to fix this was to:

1) Boot off of the installation disc
2) Mount the partition holding the root partition on /mnt, e.g.:
Code:

mount -t ext4 /dev/sda1 /mnt
3) Enter an interactive shell with the mounted partition as root directory:
Code:

chroot /mnt
4) Change directory to /boot and review the file README.initrd for the official description of the initrd building process and usage. You should also review the man page for the mkinitrd command.
5) Create the initrd.gz image:
Code:

mkinitrd -c -f ext4 -r /dev/sda1 -m hv_vmbus:hv_storvsc:mbcache:jbd2:ext4 -u -o /boot/initrd.gz
6) Follow the instructions in /boot/README.initrd to edit /etc/lilo.conf and run lilo to set up and install the boot loader.

If you used a root filesystem other than ext4 or a partition other than /dev/sda1, you'll need to adjust the commands in steps #2 and #5. The hv_vmbus and hv_storvsc modules were the key to getting it working under Hyper-V while the mbcache, jbd2, and ext4 modules were required to use the generic kernel with the ext4 root filesystem. You can also try using the /usr/share/mkinitrd/mkinitrd_command_generator.sh script to automatically generate the command appropriate for you to use in step #5.

skush 12-03-2013 10:27 PM

Thanks
 
Your method worked flawlessly, and in reading that file, I gained a basic understanding of initrd. Thank you very much.

ReaperX7 12-03-2013 10:53 PM

Alternatively you can also use the Huge kernel which doesn't require an initrd.gz.

CeeWave 12-04-2013 07:16 AM

skush, You're welcome, I'm glad you were able to to get it to work.

ReaperX7, using the Huge kernel often avoids requiring an initrd.gz. Unfortunately, by design or oversight, the Hyper-V support is provided by modules in both the Huge and Generic 3.10.17 kernels.

Huge:
Code:

bash-4.2# grep HYPERV /boot/config-huge-3.10.17
CONFIG_HYPERVISOR_GUEST=y
# CONFIG_SYS_HYPERVISOR is not set
CONFIG_HYPERV_STORAGE=m
CONFIG_HYPERV_NET=m
# CONFIG_FB_HYPERV is not set
CONFIG_HID_HYPERV_MOUSE=m
CONFIG_HYPERV=m
CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_BALLOON=m

and Generic:
Code:

bash-4.2# grep HYPERV /boot/config-generic-3.10.17
CONFIG_HYPERVISOR_GUEST=y
# CONFIG_SYS_HYPERVISOR is not set
CONFIG_HYPERV_STORAGE=m
CONFIG_HYPERV_NET=m
# CONFIG_FB_HYPERV is not set
CONFIG_HID_HYPERV_MOUSE=m
CONFIG_HYPERV=m
CONFIG_HYPERV_UTILS=m
CONFIG_HYPERV_BALLOON=m

necessitating the use of an initrd image with either kernel.

Strykar 07-01-2016 09:45 PM

I use ext4 and even on 14.2 I use
Quote:

mkinitrd -c -f ext4 -r /dev/sda1 -m hv_vmbus:hv_storvsc -u -o /boot/initrd.gz
I wish I'd commented my 14.1's (kernel 4.0.1) lilo.conf because I found I would use
Quote:

append="vt.default_utf8=0 raid=noautodetect hyperv_clocksource"
This is from
Quote:

# ls -l /sys/devices/system/clocksource/clocksource0/
total 0
-r--r--r-- 1 root root 4096 Jul 2 08:12 available_clocksource
-rw-r--r-- 1 root root 4096 Jul 2 08:12 current_clocksource
drwxr-xr-x 2 root root 0 Jul 2 08:12 power/
lrwxrwxrwx 1 root root 0 Jul 2 08:12 subsystem -> ../../../../bus/clocksource/
-rw-r--r-- 1 root root 4096 Jul 2 2016 uevent
--w------- 1 root root 4096 Jul 2 08:12 unbind_clocksource
Telling lilo the clocksource isn't required, I tested it.
On 14.2 hyperv_clocksource_tsc_page is used by default.

a4z 07-02-2016 12:41 AM

Hej Strykar, thanks for the info

what does this mean?
Quote:

Originally Posted by Strykar (Post 5569165)
I wish I'd commented my 14.1's (kernel 4.0.1) lilo.conf because I found I would use

This is from
Telling lilo the clocksource isn't required, I tested it.

On 14.2 hyperv_clocksource_tsc_page is used by default.

no extra parameter for lilo?


I wish this additional work would not be required and Slackware could work on Hyper-V out of the box.
I understand that most here do not need this, and therefor do not know/understand, but for certain development work on windows you need to use Hyper-V what disables VMWare (or limits it to 1 32bit CPU), switching between Hyper-V on of on the fly is not possible.

This makes people of course using something else, understandable, even I hate to fiddle around and fix this since my primary interests are getting dev jobs done, not fixing pre loaded modules, a stupid work someone has to do over and over again for each installation.

Strykar 07-02-2016 01:05 AM

Quote:

Originally Posted by a4z (Post 5569206)
Hej Strykar, thanks for the info

what does this mean?


no extra parameter for lilo?


I wish this additional work would not be required and Slackware could work on Hyper-V out of the box.

Hi! It means to get Hyper-V support without the huge.s kernel, you need just 2 modules - hv_vmbus and hv_storvsc

I'd specified clocksource because of a kernel panic in the past.
No extra parameters are required in lilo.conf

The issue why initrd is required is due to the way Hyper-V is bundled in the kernel.
It seems unlikely to get Slackware working out of the box as a Hyper-V guest unless kernel.org changes the way Hyper-V is bundled.
Just follow CeeWave's instructions above when you install and setup the initrd right after completing the install before rebooting.

I often get trolled for using Slackware under Hyper-V, but they have 4 datacenters in India which are important to me and facts speak for themselves - http://www.geekwire.com/2016/azure-r...tanley-survey/

marky9074 02-10-2018 01:59 AM

Sorry to resurrect this thread. Successfully installed 14.2 and followed the instructions for the initrd OK. However once I upgrade all, I cannot mount my /dev/sda2 with 'No kernel modules found for Linux 4.4.115'....

Any help would be much appreciated.

Cheers,

Mark

a4z 02-10-2018 11:04 AM

possible you updated the kernel? than you should have rebuild the initrd for the new kernel before rebooting.

marky9074 02-11-2018 04:04 PM

I tried to make a new initrd.gz but it has more or less same error:

ERROR: No /lib/modules/4.4.14 kernel modules tree found for kernel "4.4.14"

So I renamed 4.4.115 to 4.4.14 and rerun the mkinitrd and re-run lilo, but it just stayed at the dots at the top of the screen when booting. I then booted back of install media and tried again, but the same. What is telling mkinitrd to use those modules? I looked and there is no mkinitrd.conf in /etc and the sample file has no obvious link to a kernel tree....

marky9074 02-12-2018 01:33 AM

OK I booted of media install again, and re-run mkinitrd and then lilo (which complained of no /proc/partitions). This time it booted past the dots and got to 'No kernel moduled found for Linux 4.4.115'...

I feel I am getting closer, but maybe should just stay with the stock 14.2 off the disk with multilib, as I'm only doing some quick testing...

a4z 02-12-2018 01:44 AM

I think this is one of the issues that have to be fixed from distribution site
to me it seems it is just activate the, for hyper-v required, modules in the kernel config.
There are obviously use cases for running Slackware on hyper-v, it is possible with a workarroundm, but an updates break it since it will replace the kernel and you need to know that after the update and before the reboot you need to apply the mkinitrd for the newly installed kernel, so form what I see this looks like it is not working properly (to avoid the word broken).
But maybe there is some deeper reason why hyper-v is not activated per default for Slackware, if so, it would be nice to know.

bassmadrigal 02-13-2018 06:15 PM

You need to use the -k option with mkinitrd or mkinitrd_command_generator.sh to make sure it's going to look for the correct kernel modules.

Code:

/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 4.4.115

marky9074 02-22-2018 12:51 AM

Quote:

Originally Posted by bassmadrigal (Post 5819568)
You need to use the -k option with mkinitrd or mkinitrd_command_generator.sh to make sure it's going to look for the correct kernel modules.

Code:

/usr/share/mkinitrd/mkinitrd_command_generator.sh -k 4.4.115

Sorry not been back until now. Took a minute to realise that this essentially just creates a suggestion of the command to use to make initrd. Therefore the only difference to the previous string was to add the -k 4.4.115 which worked well.

Thanks for the help.

Code:

mkinitrd -c -k 4.4.115 -f ext4 -r /dev/sda2 -m hv_vmbus:hv_storvsc:mbcache:jbd2:ext4 -u -o /boot/initrd.gz

dalacor 05-17-2020 07:06 AM

1 Attachment(s)
I am probably missing a step somewhere or not understanding something. I have always run Slackware bare metal in the past.

I have installed Slackware as follows:

/dev/sda1 as 200mb EFI (which seems to be Vfat). Not sure if this is relevant
/dev/sda2 as 2gb Swap.
/dev/sda3 as 100GB EXT4 (This is where Slackware and all the applications are installed).

My understanding is that I run the menu setup in the normal way including setting up eliloconfig, fstab etc and when I get to the end and exit, I instead no I don't want to reboot.

Then I type the following commands:

mount -t ext4 /dev/sda3 /mnt (to mount my slackware partition where I just installed Slackware)
chroot /mnt
cd /boot
mkinitrd -c -k 4.19.27 -f ext4 -r /dev/sda3 -m hv_vmbus:hv_storvsc -u -o /boot/initrd.gz OR mkinitrd -c -k 4.19.27 -f ext4 -r /dev/sda3 -m hv_vmbus:hv_storvsc:mbcache:jbd2:ext4 -u -o /boot/initrd.gz (with same result)

Restart Linux and boot up Slackware in the normal way.

I have attached a screenshot of the error messages that I am getting. I have tried a number of different things, but I can't seem to work out what the problem is other than the fact that it might be that /boot/efi/.... directories don't seem to show up and this might be the issue? Hopefully I have just missed a step somewhere.

dalacor 05-17-2020 11:18 AM

I had a break from this. Looking through my notes again I see I forgot to run eliloconfig. So I ran mount -t vfat /dev/sda1 /boot/efi (after cd /boot command) and then ran eliloconfig after I ran the mkinitrd command. Then shut down the VM again. But I am getting pretty much the same messages. Various websites keep talking about creating a lilo.conf file /etc, but I am using elilo and the config is not in /etc, it's in /boot/efi/EFI/slackware so I am doing this by running Eliloconfig but it is clearly not working.

bassmadrigal 05-17-2020 12:47 PM

The errors state that "Exec format error". This could mean that you installed a 64bit module package with a 32bit kernel.

It'd probably be a better suggestion to create a new post instead of resurrecting a 2 year old post.

rkelsen 05-17-2020 04:45 PM

Quote:

Originally Posted by dalacor (Post 6124259)
Various websites keep talking about creating a lilo.conf file /etc, but I am using elilo and the config is not in /etc, it's in /boot/efi/EFI/slackware so I am doing this by running Eliloconfig but it is clearly not working.

Actually, that part is working. It is finding and loading the kernel. Your problem is that the ext4 module isn't loading and therefore the kernel can't see the root filesystem.

As to the reason for that, I'm not 100% sure. Check what bassmadrigal suggested as a starting point.

Edit: The quickest/easiest fix is to compile filesystem support into your kernel. Choose (Y) instead of (M) for the filesystem you're using. That'll circumvent any initrd issues, etc.

dalacor 05-18-2020 01:35 PM

I haven't the slightest idea what the original cause was. I downloaded the latest Current ISO as the Current ISO I had was from March last year. I installed Slackware in the normal way and exited the install menu.

Then I did the following:

chroot /mnt
mkinitrd -c -k 5.4.41 -f ext4 -r /dev/sda3 -m hv_vmbus:hv_storvsc:mbcache:jbd2:ext4 -u -o /boot/initrd.gz
(replace 5.4.41 with current Linux version)
Eliloconfig
Reboot Computer

This worked flawlessly. I can only assume that there was something wrong with the version of Slackware current that I had?

When I update all the Slackware packages including the kernel on a bare metal machine - I normally use this command to update the kernel

mkinitrd -c -k 5.4.20 -m

I assume with a virtual machine setup, when I update Slackware to the latest version I need to run this command instead

mkinitrd -c -k 5.4.41 -f ext4 -r /dev/sda3 -m hv_vmbus:hv_storvsc:mbcache:jbd2:ext4 -u -o /boot/initrd.gz
(replace 5.4.41 with current Linux version)

Is it really necessary to have -f ext4 -r and the -u and -o and /boot/initrd.gz bits because I don't have this on a bare metal setup. Is the -c -k and -m not sufficient?

I am delighted to have got this working. I will now setup my minimal Slack install.

rkelsen 05-18-2020 04:41 PM

Slackware 14.1 in MS Hyper-V
 
Good to see you got it working!

Next challenge: Install the integration package for HyperV.

The best part: All you need is an internet connection and you'll be able to administer the machine from anywhere.

Happy trails my friend.


All times are GMT -5. The time now is 01:00 PM.