Method and system for installing an operating system (OS) in a host computer system. The method comprises: receiving user parameters required during OS installation in a pre-boot execution environment and generating an unattended installation pack; transferring the unattended installation pack to a baseboard management controller (BMC); sending a control command to the BMC to instruct the BMC to mount the installation pack as a universal serial bus (USB) key; and installing the OS in the host in response to receiving a reply from the BMC, wherein during the OS installation process, the unattended pack is obtained from the USB key so as to acquire the user parameters in the installation process. The method and system make it possible for the OS installation to use no external storage or network apparatus and thus the required resources are reduced in the OS installation for a host.