1. This website uses cookies to improve service and provide a tailored user experience. By using this site, you agree to this use. See our Cookie Policy.
    Dismiss Notice
  2. The hosting section is sponsored by Hostwinds visit the BHW Partnership program for your exclusive BHW member hosting benefit today.
    MUST be signed into your BHW account.
    Dismiss Notice

[Script] Turn your Linux VPS/Server into Windows Server automatically using Shell script

Discussion in 'Web Hosting' started by sohom, Feb 23, 2019.

  1. Almighty Pull

    Almighty Pull Regular Member

    Joined:
    Jan 16, 2019
    Messages:
    322
    Likes Received:
    195
    Gender:
    Male
    I have a new problem at hand, the damn VNC viewer, when I connect to port zero as in final step, it shows "Timed out waiting for a response from the computer" even though the console shows Job done.
    Can anyone help with this?
    Thanks
     
  2. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,065
    Likes Received:
    240
    Occupation:
    Coder | Programmer
    Location:
    Automation
    Home Page:
    never encountered such issue!
    In that case, must be there were some error message(s), which you are missing
    I would make some changes in the script,so user could debug upto some extension.

    Anyway,if you had opted for deleting existing Linux-OS, then your only option is, just reinstall Linux-OS(as existing one already deleted by the Script) and then re-run the script.
    If you did opt for Linux-OS deletion, then run below 3 commands :
    Code:
    umount -l /mnt /media/script
    rm -rf /mediabots /floppy /virtio /media/* /tmp/*
    rm -f /sw.iso /disk.img 
    It would remove previous Windows-OS instance.
    then run below code :
    Code:
    for i in $(ps  aux | grep -i "qemu-system" | head -2 | cut -f7 -d" ") ; do echo "killing process id : "$i ; kill -9 $i ; done
    that would kill all running QEMU-KVM processes
    now re-run the script

    Regards
     
    Last edited: Feb 26, 2019
  3. stromind

    stromind Jr. VIP Jr. VIP

    Joined:
    Oct 1, 2018
    Messages:
    172
    Likes Received:
    33
    Gender:
    Male
    Occupation:
    system administrator
    Location:
    localhost
    Home Page:
    Just a suggestion, please include virtualization check in your script,
     
    • Thanks Thanks x 1
  4. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,065
    Likes Received:
    240
    Occupation:
    Coder | Programmer
    Location:
    Automation
    Home Page:
    Sure. It is added now.
    thanks

    ---------------------------

    Updates

    Debian Distro support added
    So script would work upto Debian 8.xx

    Regards
     
    • Thanks Thanks x 1
  5. feezioxiii

    feezioxiii Jr. VIP Jr. VIP

    Joined:
    Nov 7, 2015
    Messages:
    696
    Likes Received:
    228
    Gender:
    Male
    Occupation:
    VPS PROVIDER
    Location:
    localhost
    Home Page:
    Just a side note, this is called as Nested Virtualization feature and make it possible by enabling another layer of virtualization on your VPS (so your VPS can create VPS).

    The result in performance is significantly lower than traditional virtualization and is not recommended for any production works :D

    The script provided is great though! Kudos to OP for his hard work!
     
    • Thanks Thanks x 1
  6. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,065
    Likes Received:
    240
    Occupation:
    Coder | Programmer
    Location:
    Automation
    Home Page:
    Sorry! for double posting , but my previous reply has a typo, which was totally a misinformation
    What I meant to say :-

    never encountered such issue!
    In that case, must be there were some error message(s), which you are missing
    I would make some changes in the script,so user could debug upto some extension.

    Anyway,if you had opted for deleting existing Linux-OS, then your only option is, just reinstall Linux-OS(as existing one already deleted by the Script) and then re-run the script.
    If you did NOT opt for Linux-OS deletion, then run below 3 commands :
    Code:
    umount -l /mnt /media/script
    rm -rf /mediabots /floppy /virtio /media/* /tmp/*
    rm -f /sw.iso /disk.img 
    It would remove previous Windows-OS instance.
    then run below code :
    Code:
    for i in $(ps  aux | grep -i "qemu-system" | head -2 | cut -f7 -d" ") ; do echo "killing process id : "$i ; kill -9 $i ; done
    that would kill all running QEMU-KVM processes
    now re-run the script

    --------------------------

    btw, "Almighty Pull" already sent a PM, that his/her issue has been resolved


    Thanks
     
    • Thanks Thanks x 1
  7. Almighty Pull

    Almighty Pull Regular Member

    Joined:
    Jan 16, 2019
    Messages:
    322
    Likes Received:
    195
    Gender:
    Male
    I got your message the first time itself, thanks for further clarifying :)
     
  8. Advanced

    Advanced Jr. VIP Jr. VIP

    Joined:
    Feb 11, 2015
    Messages:
    110
    Likes Received:
    14
    Trying to find such solution. Very helpful! Thanx,
     
    • Thanks Thanks x 1
  9. Jadyfastt

    Jadyfastt Newbie

    Joined:
    Mar 7, 2019
    Messages:
    1
    Likes Received:
    0
    I ve tried tried everything in this thread i still cant use vnc viewer.. i kept getting "Timed out waiting for a response from the computer" i use scaleway.com
     
  10. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,065
    Likes Received:
    240
    Occupation:
    Coder | Programmer
    Location:
    Automation
    Home Page:
    Looks like, the server which had hosted Windows 2012 ISO file was down!
    I added a archive.org direct link for Windows 2012 ISO in that place, everything should be fine now

    **MAKE SURE TO USE UPDATED SCRIPT**

    Regards
     
  11. majdi107

    majdi107 Jr. VIP Jr. VIP

    Joined:
    Aug 28, 2014
    Messages:
    2,165
    Likes Received:
    444
    Occupation:
    BHW
    Location:
    BHW
    Home Page:
    bookmarked
    thanks for the share
     
    • Thanks Thanks x 1
  12. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,065
    Likes Received:
    240
    Occupation:
    Coder | Programmer
    Location:
    Automation
    Home Page:
    **UPDATE**

    CentOS Distro support added (tested on CentOS 7.4 , CenstOS 7.6)

    So this Script is working for Linux Distros : Ubuntu,Debian, CnetOS :)

    I also linked a fast(1Gbps) Windows server ISO image url into the script, so 4.2 GB would be downloaded within few minutes :D

    [Note]
    Since I got portable version of "QEMU-KVM" only for Ubuntu.
    So if you had opted for completely deleting existing Linux OS, it would work only on Ubuntu.

    Regards
     
    Last edited: Mar 20, 2019
  13. rajsinhahyd

    rajsinhahyd Regular Member

    Joined:
    Jun 8, 2016
    Messages:
    321
    Likes Received:
    36
    Gender:
    Male
    I am getting this error
    timeout waiting for a response from the computer vnc
     
  14. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,065
    Likes Received:
    240
    Occupation:
    Coder | Programmer
    Location:
    Automation
    Home Page:
    Ok
    let me know the VPS provider you are using
    as well as which Linux distribution( Ubuntu or Debian or CentOS, etc ) were used. Also inform me the Distro version number (such as Ubuntu 18.04 or CentOS 7.6 ,etc)
     
  15. rajsinhahyd

    rajsinhahyd Regular Member

    Joined:
    Jun 8, 2016
    Messages:
    321
    Likes Received:
    36
    Gender:
    Male
    I am using one provider dedicated server which you mentioned in your cheap dedicatedservers thread.
    It is CentOS 7.6, 64 bits
     
  16. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,065
    Likes Received:
    240
    Occupation:
    Coder | Programmer
    Location:
    Automation
    Home Page:
    PM replied @ rajsinhahyd
     
    Last edited: Apr 5, 2019
  17. rajsinhahyd

    rajsinhahyd Regular Member

    Joined:
    Jun 8, 2016
    Messages:
    321
    Likes Received:
    36
    Gender:
    Male
    Installed successfully windows server but not able to login through remote desktop.
    an authentication error has occured.
    the function requested is not supported.
    I closed my ssh before connecting rdp.
    can you give me a solution?
     
  18. welneto

    welneto Power Member

    Joined:
    Jan 24, 2015
    Messages:
    578
    Likes Received:
    99
    Home Page:
    Great thread
    thanks op
     
    • Thanks Thanks x 1
  19. stromind

    stromind Jr. VIP Jr. VIP

    Joined:
    Oct 1, 2018
    Messages:
    172
    Likes Received:
    33
    Gender:
    Male
    Occupation:
    system administrator
    Location:
    localhost
    Home Page:
    try unchecking the the box shown in the screenshot
    http://prntscr.com/n880xg
     
    • Thanks Thanks x 1
  20. sohom

    sohom Senior Member

    Joined:
    May 26, 2013
    Messages:
    1,065
    Likes Received:
    240
    Occupation:
    Coder | Programmer
    Location:
    Automation
    Home Page:
    I attached a .ps1 script under CD-ROM to auto enable RDP in Windows Server in 1st place.
    Seems like you missed it.

    I found this(enable rdp) TUT on yt useful

    generally you have to do 2 or 3 things , its easy :p