Booting into Ubuntu after first booting into Windows disables sound on Ubuntu. I tried cold restarting again and switched between Ubuntu and Windows but the issue remains same. Then I switched back to Ubuntu but the sound was not working again. So I switched to Windows and disabled Fast Boot in power options. I tried to cold restart (holding power button for ~5 sec) laptop and log into Ubuntu first, and now the sound worked.
Somewhere on the Internet I read that the issue could be caused by Windows Fast Boot.
I later tried modifying nf file as pointed out here, but it also didn't help. As I later switched back to Ubuntu, no sound was coming out of speakers again so I tried the same as before (step #1C), but now it didn't solve the problem ( no updates were installed as the system was up to date). I later restarted and switched to Windows. So I've tried this guide, and found out step #1C helped ( it installed some updates). But I found out no sound is coming out of my speakers when using Ubuntu (sound works fine on Windows). Recently I decided to try Linux, so I installed Ubuntu 16.04 LTS as a dual-boot option to already installed Windows 10 on my laptop. If all you want is the Windows 7 startup sound, your work here is done. Microsoft stopped trying to create new startup sounds. TL DR: Booting into Ubuntu after first booting into Windows disables sound on Ubuntu (dual-boot Ubuntu 16.04 LTS/Windows 10) The first surprise is that the default startup sound played by Windows 10 is the sound from Windows 7 Yeah, that's right.