Another big name, which is always attached to the figure of Sunan Terboyo is his great-grandfather, namely Kyai Bustam Kertoboso. He was the first person to give the idea to establish two kingdoms, namely Surakarta and Yogyakarta. He is also believed to have designed most of the final agreement between Prince Mangkubumi and the Dutch. At that time, the rebels led by Prince Mangkubumi were already around Semarang. However, no one dared to bring a letter to Prince Mangkubumi. Many dukes were asked to bring a letter to Prince Mangkubumi, but most of them preferred to resign rather than carry out the dangerous task. At that deadlock, Kyai Bustam appeared and was willing to carry out the task alone.
He disguised himself as a grass cutter. After going through various dangers, he was finally able to meet Prince Mangkubumi. Initially he was treated as a prisoner, but after Kyai Bustam showed the letter he brought, he received the respect he deserved. In the meeting, Kyai Bustam stated that the rebellion carried out by Prince Mangkubumi was the result of the Dutch political error against Mangkubumi. After meeting with Prince Mangkubumi, Kyai Bustam met with the Dutch and told the Dutch that Prince Mangkubumi had the right to become the king of Java. This was because Prince Mangkubumi was the son of the king of Kartasura, Amangkurat IV and the younger brother of the recently deceased king, Paku Buwana II. The result of the negotiation was the Giyanti Agreement at the foot of Mount Lawu, which separated the two great powers of Java, namely Surakarta and Yogyakarta on February 13, 1755. At that time, the meeting between Nicholaas Hartingh and Mangkubumi was only witnessed by Kyai Bustam as a translator and Patih Natakusuma (Ricklefs, 2002: 102). This was possible thanks to the mediation and advice of Kyai Bustam. Finally, the war between Prince Mangkubumi and the Dutch was ended by giving power to Prince Mangkubumi who later became Sultan Hamengku Buwana I, Sultan of Yogyakarta Hadiningrat.
Although it is difficult to find written history about Kanjeng Terboyo, there is one historical relic that still stands majestically today, namely the Great Mosque of Terboyo. This mosque has a distinctive feature, namely a teak pulpit with unique carvings. On the back of the preacher's seat, there is an inscription stating that this mosque was built by Kanjeng Terboyo. The Haul of Kanjeng Terboyo which is held every 1 Muharram, is the peak of the pilgrimage of the people of Semarang and its surroundings, in addition to other times, such as Ruwah and Syawal.