The entrepreneur was a last-minute addition to the SXSW schedule after he flew to Austin to support friend Jonathan Nolan.

One day after good friends Jonathan Nolan and Elon Musk shared the stage at SXSW to discuss Nolan's latest endeavor, the second season of Westworld, they reunited for a talk that was all about Musk's work with rockets and electric cars.

From the moment they walked onstage (to the song "My Little Buttercup" from the classic comedy Three Amigos), it was clear the duo was having fun palling around Austin during the technology, film and music festival. Musk revealed that he had taken his kids to visit HBO's elaborate Westworld activation, set up about 30 minutes outside of downtown Austin. "It's amazing," he said. "It's incredibly well done."

Their conversation — which touched on the launch of SpaceX's Falcon Heavy, the early days of Tesla and Musk's plan to dig tunnels under Los Angeles via his Boring Company — was loose and relaxed. Though Musk said he was recovering from a cold, he was obviously enjoying himself, cracking jokes about establishing The Mars Bar (like the chocolate candy bar) and one day becoming emperor of the colony he hopes to establish on the Red Planet.

Musk surprised SXSW attendees Saturday when he appeared at the end of a panel with the cast and creators of HBO's Westworld. The entrepreneur, who met Westworld co-showrunner Nolan at a physics conference while Nolan was co-writing Interstellar with brother Christopher, got up onstage to talk about the SpaceX Falcon Heavy rocket launch and debut a short film that Nolan made to commemorate the moment. (He later made an appearance at a party hosted by Ashton Kutcher's Sound Ventures featuring a DJ set by Snoop Dogg.)

Hours after the Westworld panel, SXSW revealed that Musk would sit for a Q&A the following day. The last-minute panel sent attendees scrambling to get a spot inside Austin's Moody Theater. A line stretched around the block Sunday morning an hour and a half before the panel was set to begin. The talk itself was delayed by more than 30 minutes because of how long it took to seat the the large crowd.

The Q&A marked Musk's first time back at SXSW since his 2013 keynote, in which he revealed that he would like to die on Mars, "just not on impact." That year, Musk's Telsa teamed with Uber to offer rides in the electric vehicles during the conference.

On Sunday, Musk and Nolan played an encore of the Falcon Heavy trailer they made after the Feb. 6 launch, which sent a Tesla into space. Musk explained that his goal with the Falcon Heavy launch and subsequent plans to build an interplanetary space shuttle is to "inspire you and make people believe again" in the continuation of space exploration. And though he acknowledged that his timelines have been criticized in the past for being too optimistic, he also predicted that SpaceX will "be able to do short flights, sort of up and down flights [to Mars], probably sometime in the first half of next year."

He also fielded questions from the audience about his plans for Mars. He revealed that after an initial infrastructure is built, he will be looking for entrepreneurs who can help him establish a new civilization. "Mars will need everything from iron foundries to pizza joints to night clubs. Mars should really have great bars," he added.

Later, when asked about the political structure on Mars, Musk said he envisions a direct democracy where everyone votes on each law. He also said he would recommend a limit on the length of laws. "If the size of a law exceeds the length of Lord of the Rings, something's wrong," he said to laughs, explaining that they should be easy to comprehend.

The audience was also very interested in how Musk spends his time. He explained that he devotes most of his business time to SpaceX and Tesla, despite his involvement in the Boring Co. and Neuralink. "It may sound like I have a lot of endeavors, but it's overwhelmingly SpaceX and Tesla," he said.

Other facts that Musk revealed during the talk: He says he's inspired by Kanye West and Fred Astaire and revealed that the two most stressful things in his life right now are fears about AI and production of the Tesla Model 3.

And Musk set the record straight on his thoughts about Silicon Valley, which he was quoted as criticizing after its season one premiere. "It starts to get very accurate around episode four," he said. "The first few episodes struck me as Hollywood making fun of Hollywood's idea of Silicon Valley. ... By season two, it's amazing."

Bringing the panel full circle, Musk brought his brother Kimbal onstage for the final 10 minutes to discuss the early days of Tesla. They ended their session with an acoustic rendition of "My Little Buttercup" as the audience sang along.

Here is it, folks, what you’ve all been waiting for. Elon & Kimbal Musk duet on My Little Buttercup from the movie THREE AMIGOS while Jonathan Nolan watches from the sidelines #sxswpic.twitter.com/pPxBdpdTzP